projectionlab-mcp 1.3.1 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/HOW-IT-WORKS.md +1 -1
  2. package/MANUAL-SETUP.md +1 -1
  3. package/README.md +18 -0
  4. package/REFERENCE.md +7 -7
  5. package/SETUP-FOR-AGENTS.md +1 -1
  6. package/dist/bootstrap.js +0 -1
  7. package/dist/bootstrap.js.map +1 -1
  8. package/dist/bridge.d.ts +8 -14
  9. package/dist/config.js +4 -2
  10. package/dist/config.js.map +1 -1
  11. package/dist/currentFinances.d.ts +4 -12
  12. package/dist/currentFinances.js +8 -44
  13. package/dist/currentFinances.js.map +1 -1
  14. package/dist/dataModel.d.ts +9 -11
  15. package/dist/dataModel.js +25 -849
  16. package/dist/dataModel.js.map +1 -1
  17. package/dist/diff.d.ts +10 -20
  18. package/dist/diff.js +30 -163
  19. package/dist/diff.js.map +1 -1
  20. package/dist/extensionBridge.d.ts +16 -15
  21. package/dist/extensionBridge.js +33 -49
  22. package/dist/extensionBridge.js.map +1 -1
  23. package/dist/index.js +4 -2
  24. package/dist/index.js.map +1 -1
  25. package/dist/layout.d.ts +32 -36
  26. package/dist/layout.js +44 -62
  27. package/dist/layout.js.map +1 -1
  28. package/dist/linkedFields.d.ts +2 -5
  29. package/dist/linkedFields.js +3 -5
  30. package/dist/linkedFields.js.map +1 -1
  31. package/dist/pathPatch.d.ts +3 -4
  32. package/dist/pathPatch.js +8 -8
  33. package/dist/pathPatch.js.map +1 -1
  34. package/dist/planSettings.d.ts +4 -6
  35. package/dist/planSettings.js +5 -9
  36. package/dist/planSettings.js.map +1 -1
  37. package/dist/plans.d.ts +2 -2
  38. package/dist/plans.js +2 -2
  39. package/dist/realEstate.d.ts +0 -21
  40. package/dist/realEstate.js +0 -117
  41. package/dist/realEstate.js.map +1 -1
  42. package/dist/resources/dataModel.d.ts +2 -6
  43. package/dist/resources/dataModel.js +12 -53
  44. package/dist/resources/dataModel.js.map +1 -1
  45. package/dist/resources/knowledge.d.ts +2 -7
  46. package/dist/resources/knowledge.js +8 -245
  47. package/dist/resources/knowledge.js.map +1 -1
  48. package/dist/resources/planData.js +1 -1
  49. package/dist/resources/planData.js.map +1 -1
  50. package/dist/settingsReport.d.ts +25 -0
  51. package/dist/settingsReport.js +464 -0
  52. package/dist/settingsReport.js.map +1 -0
  53. package/dist/settingsReportLayout.d.ts +59 -0
  54. package/dist/settingsReportLayout.js +367 -0
  55. package/dist/settingsReportLayout.js.map +1 -0
  56. package/dist/snapshot.d.ts +1 -2
  57. package/dist/snapshot.js +2 -2
  58. package/dist/snapshot.js.map +1 -1
  59. package/dist/summary.d.ts +3 -8
  60. package/dist/summary.js +7 -71
  61. package/dist/summary.js.map +1 -1
  62. package/dist/tools/bootstrap.js +1 -1
  63. package/dist/tools/bootstrap.js.map +1 -1
  64. package/dist/tools/clonePlan.js +3 -3
  65. package/dist/tools/clonePlan.js.map +1 -1
  66. package/dist/tools/connection.js +3 -3
  67. package/dist/tools/connection.js.map +1 -1
  68. package/dist/tools/deletePlan.js +3 -3
  69. package/dist/tools/deletePlan.js.map +1 -1
  70. package/dist/tools/diff.js +17 -23
  71. package/dist/tools/diff.js.map +1 -1
  72. package/dist/tools/export.js +2 -2
  73. package/dist/tools/export.js.map +1 -1
  74. package/dist/tools/getCurrentFinances.js +8 -48
  75. package/dist/tools/getCurrentFinances.js.map +1 -1
  76. package/dist/tools/getPlan.js +2 -4
  77. package/dist/tools/getPlan.js.map +1 -1
  78. package/dist/tools/getPlanSection.js +19 -10
  79. package/dist/tools/getPlanSection.js.map +1 -1
  80. package/dist/tools/getPlanSettings.js +8 -12
  81. package/dist/tools/getPlanSettings.js.map +1 -1
  82. package/dist/tools/restore.js +12 -87
  83. package/dist/tools/restore.js.map +1 -1
  84. package/dist/tools/schema.js +16 -71
  85. package/dist/tools/schema.js.map +1 -1
  86. package/dist/tools/settingsReport.d.ts +3 -0
  87. package/dist/tools/settingsReport.js +76 -0
  88. package/dist/tools/settingsReport.js.map +1 -0
  89. package/dist/tools/snapshots.js +9 -14
  90. package/dist/tools/snapshots.js.map +1 -1
  91. package/dist/tools/summary.js +1 -1
  92. package/dist/tools/summary.js.map +1 -1
  93. package/dist/tools/updateAccount.js +16 -26
  94. package/dist/tools/updateAccount.js.map +1 -1
  95. package/dist/tools/updatePlanEvent.js +10 -10
  96. package/dist/tools/updatePlanEvent.js.map +1 -1
  97. package/dist/tools/updatePlanSection.js +4 -5
  98. package/dist/tools/updatePlanSection.js.map +1 -1
  99. package/dist/tools/updatePlanSettings.js +4 -4
  100. package/dist/tools/updatePlanSettings.js.map +1 -1
  101. package/dist/tools/writeGuard.d.ts +3 -2
  102. package/dist/tools/writeGuard.js +5 -4
  103. package/dist/tools/writeGuard.js.map +1 -1
  104. package/dist/types/projectionlab.d.ts +4 -5
  105. package/dist/types/wire.d.ts +1 -1
  106. package/dist/types/wire.js.map +1 -1
  107. package/package.json +1 -1
  108. package/skills/projectionlab/SKILL.md +78 -64
  109. package/dist/resources/layoutResource.d.ts +0 -19
  110. package/dist/resources/layoutResource.js +0 -43
  111. package/dist/resources/layoutResource.js.map +0 -1
package/dist/dataModel.js CHANGED
@@ -11,134 +11,19 @@ import { ProjectionLabError } from "./errors.js";
11
11
  * stored-value test.
12
12
  * - "export-shape": the field and its value type appear in a ProjectionLab 5
13
13
  * export; its meaning is not yet confirmed by a stored-value test.
14
- * Only fields confirmed against ProjectionLab 4.6.0 or 5.0.0 are listed;
15
- * fields known from names alone are left out entirely.
14
+ * Only fields confirmed against ProjectionLab 5.0.0, or plan settings
15
+ * confirmed against ProjectionLab 4.6.0 and carried as export-shape, are
16
+ * listed; fields known from names alone are left out entirely.
16
17
  */
17
- export const DATA_MODEL_PROJECTIONLAB_VERSION = "4.6.0";
18
18
  export const DATA_MODEL_V5_PROJECTIONLAB_VERSION = "5.0.0";
19
19
  const PCT = "percentage points";
20
20
  const FRAC = "decimal fraction";
21
21
  const DOLLARS = "dollars";
22
22
  const YEARS = "years";
23
- // A one-time event (frequency "once") keeps the end reference it was created
24
- // with: the UI hides it and the simulation ignores it. Confirmed in the Cash
25
- // Flow view with one-time inheritances dated after a retirement milestone
26
- // that their stored end ("exclude" "retirement") would otherwise cut off.
27
- const ONE_TIME_END_NOTE = 'On a one-time event (frequency "once") the end reference is a leftover default: the UI hides it and the simulation ignores it, so it is not a user setting.';
28
- function timingFields(prefix) {
29
- const endNote = prefix === "end" ? ONE_TIME_END_NOTE : undefined;
30
- const modifierNote = '"include" counts the milestone year itself; "exclude" leaves it out (an end of "exclude" "retirement" stops the year before retirement); an integer means that many years after it.';
31
- return {
32
- [`${prefix}.type`]: {
33
- description: `Kind of the ${prefix} reference: a fixed date, a keyword, or a milestone.`,
34
- allowedValues: ["date", "keyword", "milestone"],
35
- evidence: "ui-label",
36
- note: endNote,
37
- },
38
- [`${prefix}.value`]: {
39
- description: `Target of the ${prefix} reference: "YYYY-MM-DD" when type is "date", a keyword such as "now", "beforeCurrentYear", "endOfPlan", or "never" when type is "keyword", or a built-in milestone keyword such as "retirement" or a milestone ID when type is "milestone".`,
40
- evidence: "ui-label",
41
- note: endNote,
42
- },
43
- [`${prefix}.modifier`]: {
44
- description: `Offset applied to a milestone ${prefix} reference.`,
45
- note: endNote ? `${modifierNote} ${endNote}` : modifierNote,
46
- evidence: "ui-label",
47
- },
48
- };
49
- }
50
- const EVENT_IDENTITY = {
51
- name: { description: "Display label of the event.", evidence: "ui-label" },
52
- hidden: {
53
- description: "When true, the event is hidden from the timeline.",
54
- evidence: "ui-label",
55
- },
56
- owner: {
57
- description: "Which household member the event belongs to.",
58
- allowedValues: ["me", "spouse", "joint"],
59
- evidence: "ui-label",
60
- },
61
- };
62
- const EVENT_MONEY = {
63
- amount: {
64
- description: "Amount of the event in the plan's base currency.",
65
- units: DOLLARS,
66
- evidence: "ui-label",
67
- },
68
- amountType: {
69
- description: "Currency basis of the amount: real purchasing power, nominal dollars, or grown from today.",
70
- allowedValues: ["today$", "$", "grow$"],
71
- evidence: "ui-label",
72
- note: '"today$" keeps pace with inflation; "$" is a nominal figure.',
73
- },
74
- frequency: {
75
- description: "How often a recurring event repeats.",
76
- allowedValues: ["yearly", "monthly", "once"],
77
- evidence: "ui-label",
78
- },
79
- repeat: {
80
- description: "When true, the event repeats on a cadence instead of occurring once.",
81
- evidence: "ui-label",
82
- },
83
- "yearlyChange.type": {
84
- description: "How the amount changes each year.",
85
- allowedValues: [
86
- "none",
87
- "match-inflation",
88
- "fixed-rate",
89
- "fixed-amount",
90
- "curve",
91
- ],
92
- evidence: "ui-label",
93
- },
94
- "yearlyChange.amount": {
95
- description: "Magnitude of the yearly change.",
96
- note: 'Percentage points when yearlyChange.type is "fixed-rate"; a dollar amount when it is "fixed-amount".',
97
- evidence: "ui-label",
98
- },
99
- "yearlyChange.amountType": {
100
- description: "Currency basis of yearlyChange.amount.",
101
- allowedValues: ["today$", "$"],
102
- evidence: "ui-label",
103
- },
104
- "yearlyChange.limitEnabled": {
105
- description: "When true, caps the yearly change at yearlyChange.limit.",
106
- evidence: "ui-label",
107
- },
108
- "yearlyChange.limit": {
109
- description: "Cap applied when yearlyChange.limitEnabled is true.",
110
- units: PCT,
111
- evidence: "ui-label",
112
- },
113
- };
114
- function sharedEventFields() {
115
- return {
116
- ...EVENT_IDENTITY,
117
- ...EVENT_MONEY,
118
- ...timingFields("start"),
119
- ...timingFields("end"),
120
- };
121
- }
122
- const EARLY_WITHDRAWAL_FIELDS = {
123
- hasEWPenalty: {
124
- description: "When true, early withdrawals before EWAge incur a penalty.",
125
- evidence: "observed",
126
- },
127
- EWPenaltyRate: {
128
- description: "Penalty charged on early withdrawals.",
129
- units: PCT,
130
- enabledBy: "hasEWPenalty",
131
- note: "Commonly 10 for retirement accounts and 20 for an HSA.",
132
- evidence: "observed",
133
- },
134
- EWAge: {
135
- description: "Age after which the early withdrawal penalty no longer applies.",
136
- units: "age",
137
- enabledBy: "hasEWPenalty",
138
- evidence: "observed",
139
- },
140
- };
141
- export const DATA_MODEL_GROUPS = [
23
+ // Plan settings groups as confirmed against ProjectionLab 4.6.0. ProjectionLab
24
+ // 5 stores the same fields; DATA_MODEL_V5_GROUPS carries them as
25
+ // export-shape until each is confirmed there by a stored-value test.
26
+ const PLAN_SETTINGS_GROUPS = [
142
27
  {
143
28
  scope: "variables",
144
29
  title: "Plan settings: variables (assumptions, tax, estate, flows)",
@@ -653,705 +538,6 @@ export const DATA_MODEL_GROUPS = [
653
538
  },
654
539
  },
655
540
  },
656
- {
657
- scope: "income",
658
- title: "Income events",
659
- fields: {
660
- ...sharedEventFields(),
661
- type: {
662
- description: "Kind of income event.",
663
- allowedValues: [
664
- "salary",
665
- "hourly",
666
- "rsu",
667
- "inheritance",
668
- "side-hustle",
669
- "tax-credit",
670
- "tax-deduction",
671
- "pension",
672
- "social-security",
673
- "old-age-security",
674
- "canada-pension-plan",
675
- "other",
676
- ],
677
- evidence: "ui-label",
678
- },
679
- taxCharacter: {
680
- description: "How the income is characterized for tax.",
681
- allowedValues: ["auto", "ordinary", "capital-gains"],
682
- evidence: "ui-label",
683
- },
684
- withholdingMode: {
685
- description: "Whether tax withholding is estimated automatically or customized.",
686
- allowedValues: ["auto", "custom"],
687
- evidence: "ui-label",
688
- },
689
- taxExempt: {
690
- description: "When true, the income is exempt from tax.",
691
- evidence: "ui-label",
692
- },
693
- goPartTime: {
694
- description: "When true, models a phased transition to part-time work.",
695
- evidence: "ui-label",
696
- },
697
- partTimeRate: {
698
- description: "Share of full salary earned while part-time.",
699
- units: PCT,
700
- enabledBy: "goPartTime",
701
- note: "50 means half salary.",
702
- evidence: "ui-label",
703
- },
704
- hasPension: {
705
- description: "When true, employer-sponsored defined-benefit pension accrual is modeled.",
706
- evidence: "ui-label",
707
- },
708
- pensionContributionType: {
709
- description: "Basis of the pension contribution.",
710
- allowedValues: ["%", "$"],
711
- enabledBy: "hasPension",
712
- evidence: "ui-label",
713
- },
714
- pensionPayoutType: {
715
- description: "Basis of the pension payout.",
716
- allowedValues: ["fap", "average", "today$", "$"],
717
- enabledBy: "hasPension",
718
- evidence: "ui-label",
719
- note: '"fap" is a percentage of final pay; "average" a percentage of career average pay.',
720
- },
721
- pensionPayoutRate: {
722
- description: "Pension payout as a percentage figure.",
723
- units: PCT,
724
- enabledBy: "hasPension",
725
- evidence: "ui-label",
726
- },
727
- hoursPerWeek: {
728
- description: "Hours worked per week (hourly wage events).",
729
- units: "count",
730
- evidence: "ui-label",
731
- },
732
- estimateIncome: {
733
- description: "When true, the Social Security benefit is estimated from earnings history; when false, amount is entered manually.",
734
- evidence: "observed",
735
- },
736
- primaryInsuranceAmount: {
737
- description: "Monthly benefit at full retirement age used by the automatic estimate.",
738
- units: DOLLARS,
739
- enabledBy: "estimateIncome",
740
- evidence: "observed",
741
- },
742
- expectedPercent: {
743
- description: "Share of the statutory benefit expected to be paid.",
744
- units: PCT,
745
- enabledBy: "estimateIncome",
746
- note: "100 assumes full benefits; a lower figure models trust fund exhaustion.",
747
- evidence: "observed",
748
- },
749
- refundable: {
750
- description: "When true, a tax credit is refundable beyond the tax owed.",
751
- evidence: "ui-label",
752
- },
753
- },
754
- },
755
- {
756
- scope: "expenses",
757
- title: "Expense events",
758
- fields: {
759
- ...sharedEventFields(),
760
- type: {
761
- description: "Kind of expense event.",
762
- allowedValues: [
763
- "living-expenses",
764
- "rent",
765
- "debt",
766
- "dependent-support",
767
- "education",
768
- "health-care",
769
- "medicare",
770
- "vacation",
771
- "wedding",
772
- "charity",
773
- "travel",
774
- "medical",
775
- "emergency",
776
- "other",
777
- ],
778
- evidence: "ui-label",
779
- },
780
- spendingType: {
781
- description: "Whether the expense is essential or discretionary spending.",
782
- allowedValues: ["essential", "discretionary"],
783
- evidence: "observed",
784
- },
785
- healthcareType: {
786
- description: "How health insurance premiums are modeled.",
787
- allowedValues: ["standard", "out-of-pocket", "aca", "employer"],
788
- evidence: "observed",
789
- },
790
- supplementalType: {
791
- description: "Medicare supplemental coverage.",
792
- allowedValues: ["none", "medigap", "advantage"],
793
- evidence: "observed",
794
- },
795
- partAPremium: {
796
- description: "Medicare Part A monthly premium.",
797
- units: DOLLARS,
798
- evidence: "observed",
799
- },
800
- partBPremium: {
801
- description: "Medicare Part B monthly premium.",
802
- units: DOLLARS,
803
- evidence: "observed",
804
- },
805
- partDPremium: {
806
- description: "Medicare Part D monthly premium.",
807
- units: DOLLARS,
808
- evidence: "observed",
809
- },
810
- supplementalPremium: {
811
- description: "Medicare supplemental plan monthly premium.",
812
- units: DOLLARS,
813
- enabledBy: 'supplementalType "medigap" or "advantage"',
814
- evidence: "observed",
815
- },
816
- healthcareInflationModifier: {
817
- description: "Medical cost inflation above general inflation.",
818
- units: PCT,
819
- evidence: "observed",
820
- },
821
- fundWithAccounts: {
822
- description: "Account IDs prioritized to pay this expense, such as an HSA for health care or a 529 for education.",
823
- evidence: "ui-label",
824
- },
825
- deductFromIncomeId: {
826
- description: "Income event ID whose pay models pre-tax payroll deductions for this expense.",
827
- evidence: "ui-label",
828
- },
829
- monthlyPayment: {
830
- description: "Scheduled monthly payment for a debt expense.",
831
- units: DOLLARS,
832
- evidence: "ui-label",
833
- },
834
- monthlyPaymentType: {
835
- description: "Currency basis of monthlyPayment.",
836
- allowedValues: ["today$", "$"],
837
- evidence: "ui-label",
838
- },
839
- interestRate: {
840
- description: "Annual percentage rate of a debt expense.",
841
- units: PCT,
842
- evidence: "ui-label",
843
- },
844
- interestType: {
845
- description: "How interest accrues on a debt expense.",
846
- allowedValues: ["simple", "compound"],
847
- evidence: "ui-label",
848
- },
849
- compounding: {
850
- description: "Frequency at which interest compounds.",
851
- allowedValues: ["monthly", "yearly"],
852
- enabledBy: 'interestType "compound"',
853
- evidence: "ui-label",
854
- },
855
- hasForgiveness: {
856
- description: "When true, the debt is forgiven at forgiveAt instead of amortizing to zero.",
857
- evidence: "ui-label",
858
- },
859
- switchToMarried: {
860
- description: "When true, the wedding switches tax filing status to married filing jointly at the wedding date.",
861
- evidence: "ui-label",
862
- },
863
- donationType: {
864
- description: "Whether a charitable donation is cash or appreciated assets.",
865
- allowedValues: ["cash", "appreciated-assets"],
866
- evidence: "ui-label",
867
- },
868
- taxDeductible: {
869
- description: "When true, the expense reduces taxable income.",
870
- evidence: "observed",
871
- },
872
- itemized: {
873
- description: "When true, the deduction counts as an itemized deduction rather than above the line.",
874
- enabledBy: "taxDeductible",
875
- evidence: "observed",
876
- },
877
- },
878
- },
879
- {
880
- scope: "accounts",
881
- title: "Plan accounts",
882
- fields: {
883
- name: { description: "Display label of the account.", evidence: "ui-label" },
884
- owner: {
885
- description: "Which household member owns the account.",
886
- allowedValues: ["me", "spouse", "joint"],
887
- evidence: "ui-label",
888
- },
889
- type: {
890
- description: "Account type.",
891
- evidence: "ui-label",
892
- note: 'US types include "taxable", "crypto", "401k", "roth-401k", "457b", "roth-457b", "401a", "ira", "roth-ira", "ira:inherited", "roth-ira:inherited", "hsa", "529"; other countries add types such as "stock-isa", "uk-pension", "sipp", "tfsa", "rrsp", "superannuation", "kh".',
893
- },
894
- balance: {
895
- description: "Current balance of the account.",
896
- units: DOLLARS,
897
- evidence: "observed",
898
- },
899
- costBasis: {
900
- description: "Unadjusted tax basis tracked for capital gains on taxable accounts.",
901
- units: DOLLARS,
902
- evidence: "observed",
903
- },
904
- investmentGrowthType: {
905
- description: "How the account's growth rate is determined.",
906
- allowedValues: ["plan", "fixed", "none"],
907
- evidence: "observed",
908
- note: '"plan" follows the global rate; a custom fixed rate is stored as "fixed", not "custom".',
909
- },
910
- investmentGrowthRate: {
911
- description: "Custom annual growth rate for the account.",
912
- units: PCT,
913
- enabledBy: 'investmentGrowthType "fixed"',
914
- evidence: "observed",
915
- },
916
- dividendType: {
917
- description: "How the account's dividend yield is determined.",
918
- evidence: "ui-label",
919
- note: 'Observed values include "plan" and "none".',
920
- },
921
- dividendRate: {
922
- description: "Custom annual dividend yield for the account.",
923
- units: PCT,
924
- evidence: "observed",
925
- },
926
- ...EARLY_WITHDRAWAL_FIELDS,
927
- yearlyFee: {
928
- description: "Recurring account fee.",
929
- note: 'Interpreted per yearlyFeeType: a percentage, a percentage of earnings, or a dollar amount.',
930
- evidence: "ui-label",
931
- },
932
- yearlyFeeType: {
933
- description: "Basis of yearlyFee.",
934
- allowedValues: ["%", "%-earnings", "today$", "$"],
935
- evidence: "ui-label",
936
- },
937
- liquid: {
938
- description: "Whether the account counts toward liquid net worth.",
939
- evidence: "observed",
940
- note: 'true, false, or "EWAge" to count only once the penalty age has passed.',
941
- },
942
- withdraw: {
943
- description: "Whether the account is eligible for automatic drawdown liquidation.",
944
- evidence: "observed",
945
- note: 'true, false, "EWAge", or "after" (see withdrawAge).',
946
- },
947
- withdrawAge: {
948
- description: "Timing reference after which the account becomes eligible for drawdown.",
949
- enabledBy: 'withdraw "after"',
950
- evidence: "observed",
951
- },
952
- rmdType: {
953
- description: "Statutory required minimum distribution regime.",
954
- allowedValues: ["us", "none"],
955
- evidence: "ui-label",
956
- },
957
- },
958
- },
959
- {
960
- scope: "assets",
961
- title: "Assets (plan asset events and Current Finances real assets)",
962
- fields: {
963
- ...EVENT_IDENTITY,
964
- type: {
965
- description: "Kind of asset.",
966
- evidence: "ui-label",
967
- note: 'Known kinds: "real-estate", "land", "car", "motorcycle", "boat", "jewelry", "precious-metals", "furniture", "instrument", "machinery", "other".',
968
- },
969
- subtype: {
970
- description: "Sub-kind for real property.",
971
- evidence: "ui-label",
972
- note: '"rental" for rental property; "rental-building" for commercial property.',
973
- },
974
- initialValue: {
975
- description: "Acquisition purchase price.",
976
- units: DOLLARS,
977
- evidence: "observed",
978
- },
979
- initialValueType: {
980
- description: "Currency basis of initialValue.",
981
- evidence: "observed",
982
- },
983
- amount: {
984
- description: "Current market value of the asset.",
985
- units: DOLLARS,
986
- evidence: "observed",
987
- note: "Counts as an asset on the balance sheet.",
988
- },
989
- amountType: {
990
- description: "Currency basis of amount.",
991
- evidence: "observed",
992
- },
993
- paymentMethod: {
994
- description: "Whether the asset was bought outright or financed.",
995
- allowedValues: ["pay-in-full", "financed"],
996
- evidence: "observed",
997
- },
998
- balance: {
999
- description: "Outstanding loan principal on the asset.",
1000
- units: DOLLARS,
1001
- enabledBy: 'paymentMethod "financed"',
1002
- evidence: "observed",
1003
- note: "Counts as a liability on the balance sheet; 0 when paid in full.",
1004
- },
1005
- balanceType: {
1006
- description: "Currency basis of balance.",
1007
- evidence: "observed",
1008
- },
1009
- downPayment: {
1010
- description: "Cash down payment at acquisition.",
1011
- units: DOLLARS,
1012
- enabledBy: 'paymentMethod "financed"',
1013
- evidence: "observed",
1014
- },
1015
- downPaymentType: {
1016
- description: "Currency basis of downPayment.",
1017
- evidence: "observed",
1018
- },
1019
- monthlyPayment: {
1020
- description: "Scheduled monthly financing payment.",
1021
- units: DOLLARS,
1022
- enabledBy: 'paymentMethod "financed"',
1023
- evidence: "observed",
1024
- },
1025
- monthlyPaymentType: {
1026
- description: "Currency basis of monthlyPayment.",
1027
- evidence: "observed",
1028
- },
1029
- interestRate: {
1030
- description: "Annual percentage rate of the asset's loan.",
1031
- units: PCT,
1032
- enabledBy: 'paymentMethod "financed"',
1033
- evidence: "observed",
1034
- },
1035
- interestType: {
1036
- description: "How interest accrues on the asset's loan.",
1037
- allowedValues: ["simple", "compound"],
1038
- evidence: "observed",
1039
- },
1040
- compounding: {
1041
- description: "Frequency at which loan interest compounds.",
1042
- allowedValues: ["monthly", "yearly"],
1043
- enabledBy: 'interestType "compound"',
1044
- evidence: "observed",
1045
- },
1046
- assessedValue: {
1047
- description: "Assessed value used for property tax.",
1048
- units: DOLLARS,
1049
- evidence: "observed",
1050
- },
1051
- taxRate: {
1052
- description: "Annual property tax figure.",
1053
- note: "A dollar amount or a percentage of assessedValue, per taxRateType.",
1054
- evidence: "observed",
1055
- },
1056
- taxRateType: {
1057
- description: "Basis of taxRate.",
1058
- allowedValues: ["today$", "%"],
1059
- evidence: "observed",
1060
- note: '"%" is a percentage of assessedValue; "today$" is a dollar amount.',
1061
- },
1062
- maintenanceRate: {
1063
- description: "Annual maintenance cost.",
1064
- note: "A dollar amount or a percentage of market value, per maintenanceRateType.",
1065
- evidence: "observed",
1066
- },
1067
- maintenanceRateType: {
1068
- description: "Basis of maintenanceRate.",
1069
- allowedValues: ["today$", "%"],
1070
- evidence: "observed",
1071
- },
1072
- insuranceRate: {
1073
- description: "Annual insurance cost.",
1074
- note: "A dollar amount or a percentage of market value, per insuranceRateType.",
1075
- evidence: "observed",
1076
- },
1077
- insuranceRateType: {
1078
- description: "Basis of insuranceRate.",
1079
- allowedValues: ["today$", "%"],
1080
- evidence: "observed",
1081
- },
1082
- brokersFee: {
1083
- description: "Broker or transaction fee charged at sale.",
1084
- units: PCT,
1085
- evidence: "observed",
1086
- },
1087
- "yearlyChange.type": {
1088
- description: "How the asset's value moves each year.",
1089
- allowedValues: ["inflation+", "inflation-", "depreciate", "appreciate"],
1090
- evidence: "observed",
1091
- },
1092
- "yearlyChange.amount": {
1093
- description: "Rate of the asset's yearly value change.",
1094
- units: PCT,
1095
- evidence: "observed",
1096
- },
1097
- excludeLoanFromLNW: {
1098
- description: "When true, the asset's loan balance is excluded from liquid net worth.",
1099
- evidence: "observed",
1100
- },
1101
- sellIfNeeded: {
1102
- description: "When true, the asset is liquidated automatically if the portfolio depletes.",
1103
- evidence: "observed",
1104
- },
1105
- cancelRent: {
1106
- description: "When true, acquiring the asset cancels the rent expense.",
1107
- evidence: "observed",
1108
- },
1109
- modifyAccount: {
1110
- description: "Destination account for the net sale proceeds.",
1111
- evidence: "observed",
1112
- note: "false, true, or an account ID.",
1113
- },
1114
- repeat: {
1115
- description: "When true, the asset is re-acquired on a cadence.",
1116
- evidence: "observed",
1117
- },
1118
- repeatInterval: {
1119
- description: "Years between replacements of the asset.",
1120
- units: YEARS,
1121
- enabledBy: "repeat",
1122
- evidence: "observed",
1123
- },
1124
- repeatIntervalType: {
1125
- description: "Cadence mode for replacements.",
1126
- allowedValues: ["every"],
1127
- evidence: "observed",
1128
- },
1129
- generateIncome: {
1130
- description: "When true, the property generates modeled rental income.",
1131
- evidence: "ui-label",
1132
- },
1133
- incomeRate: {
1134
- description: "Gross rental yield of the property.",
1135
- units: PCT,
1136
- enabledBy: "generateIncome",
1137
- evidence: "ui-label",
1138
- },
1139
- managementRate: {
1140
- description: "Property management fee.",
1141
- units: PCT,
1142
- enabledBy: "generateIncome",
1143
- evidence: "ui-label",
1144
- },
1145
- monthlyHOA: {
1146
- description: "Monthly homeowners association dues.",
1147
- units: DOLLARS,
1148
- enabledBy: "generateIncome",
1149
- evidence: "ui-label",
1150
- },
1151
- estimateRentalDeductions: {
1152
- description: "When true, deducts depreciation, interest, and taxes from rental income.",
1153
- enabledBy: "generateIncome",
1154
- evidence: "ui-label",
1155
- },
1156
- estimateQBI: {
1157
- description: "When true, models the qualified business income deduction on rental income.",
1158
- enabledBy: "generateIncome",
1159
- evidence: "ui-label",
1160
- },
1161
- ...timingFields("start"),
1162
- ...timingFields("end"),
1163
- },
1164
- },
1165
- {
1166
- scope: "milestones",
1167
- title: "Milestones",
1168
- fields: {
1169
- name: { description: "Display label of the milestone.", evidence: "observed" },
1170
- id: {
1171
- description: "Built-in key or generated ID of the milestone.",
1172
- evidence: "observed",
1173
- note: 'Built-ins: "retirement", "spouseRetirement", "lifeExpectancy", "spouseLifeExpectancy", "fi"; custom milestones get a generated ID.',
1174
- },
1175
- removable: {
1176
- description: "True for user-created milestones; omitted for built-ins.",
1177
- evidence: "observed",
1178
- },
1179
- "criteria.*.type": {
1180
- description: "Kind of criterion that positions the milestone.",
1181
- allowedValues: ["date", "year", "milestone", "netWorth", "totalDebt", "age"],
1182
- evidence: "observed",
1183
- },
1184
- "criteria.*.value": {
1185
- description: "Target of the criterion.",
1186
- evidence: "observed",
1187
- note: 'A "YYYY-MM-01" date for "date" and "year" types; a milestone ID for the "milestone" type; a numeric threshold for "netWorth" and "totalDebt".',
1188
- },
1189
- "criteria.*.modifier": {
1190
- description: "Offset applied to a milestone criterion.",
1191
- evidence: "observed",
1192
- note: '"include" is the milestone year itself; an integer is that many years after it.',
1193
- },
1194
- "criteria.*.operator": {
1195
- description: "Comparison for a netWorth or totalDebt criterion.",
1196
- evidence: "observed",
1197
- note: 'Observed values include "==" and ">=".',
1198
- },
1199
- "criteria.*.valueType": {
1200
- description: "Basis of a numeric criterion value.",
1201
- evidence: "observed",
1202
- note: '"spending" expresses the value as a multiple of annual spending; "$" as dollars.',
1203
- },
1204
- "criteria.*.range": {
1205
- description: "Tolerance band around a netWorth criterion value.",
1206
- units: "count",
1207
- evidence: "observed",
1208
- },
1209
- "criteria.*.age": {
1210
- description: "Age at which an age criterion fires.",
1211
- units: "age",
1212
- evidence: "observed",
1213
- },
1214
- "criteria.*.householdMemberId": {
1215
- description: "Whose age an age criterion tracks.",
1216
- allowedValues: ["me", "spouse"],
1217
- evidence: "observed",
1218
- },
1219
- },
1220
- },
1221
- {
1222
- scope: "priorities",
1223
- title: "Priorities (cash flow routing)",
1224
- fields: {
1225
- name: { description: "Display label of the cash flow.", evidence: "observed" },
1226
- title: {
1227
- description: "Group header the flow is listed under.",
1228
- evidence: "observed",
1229
- },
1230
- type: {
1231
- description: "Target account or priority type of the flow.",
1232
- evidence: "observed",
1233
- note: 'Examples: "taxable", "ira", "roth-ira", "401k", "hsa", "savings", "emergency-fund", "debt", "asset", "transfer".',
1234
- },
1235
- goalIntent: {
1236
- description: "Whether the flow invests surplus cash or transfers between accounts.",
1237
- allowedValues: ["invest", "transfer"],
1238
- evidence: "observed",
1239
- },
1240
- accountId: {
1241
- description: "Destination account ID the flow routes to.",
1242
- evidence: "observed",
1243
- },
1244
- desiredContribution: {
1245
- description: "How much the flow receives from surplus cash flow.",
1246
- allowedValues: ["max", "fixed"],
1247
- evidence: "observed",
1248
- note: '"max" routes all remaining surplus; "fixed" takes amount.',
1249
- },
1250
- amount: {
1251
- description: "Fixed contribution taken when desiredContribution is \"fixed\".",
1252
- units: DOLLARS,
1253
- evidence: "observed",
1254
- },
1255
- amountType: {
1256
- description: "Currency basis of amount.",
1257
- evidence: "observed",
1258
- },
1259
- frequency: {
1260
- description: "How often the flow is funded.",
1261
- evidence: "observed",
1262
- note: 'Examples: "yearly", "monthly".',
1263
- },
1264
- owner: {
1265
- description: "Household member the flow belongs to.",
1266
- allowedValues: ["me", "spouse", "joint"],
1267
- evidence: "ui-label",
1268
- },
1269
- ...timingFields("start"),
1270
- ...timingFields("end"),
1271
- },
1272
- },
1273
- {
1274
- scope: "savingsAccounts",
1275
- title: "Current Finances: savings accounts",
1276
- fields: {
1277
- name: { description: "Display label of the account.", evidence: "ui-label" },
1278
- balance: {
1279
- description: "Cash balance of the account.",
1280
- units: DOLLARS,
1281
- evidence: "ui-label",
1282
- },
1283
- interestRate: {
1284
- description: "Annual percentage yield paid on the balance.",
1285
- units: PCT,
1286
- evidence: "ui-label",
1287
- },
1288
- owner: {
1289
- description: "Which household member owns the account.",
1290
- allowedValues: ["me", "spouse", "joint"],
1291
- evidence: "ui-label",
1292
- },
1293
- },
1294
- },
1295
- {
1296
- scope: "investmentAccounts",
1297
- title: "Current Finances: investment accounts",
1298
- fields: {
1299
- name: { description: "Display label of the account.", evidence: "ui-label" },
1300
- type: {
1301
- description: "Account type.",
1302
- evidence: "ui-label",
1303
- note: 'For example "taxable", "ira", "401k", "roth-ira", "hsa".',
1304
- },
1305
- balance: {
1306
- description: "Current balance of the account.",
1307
- units: DOLLARS,
1308
- evidence: "ui-label",
1309
- },
1310
- costBasis: {
1311
- description: "Unadjusted tax basis, required for taxable brokerage accounts.",
1312
- units: DOLLARS,
1313
- evidence: "ui-label",
1314
- },
1315
- owner: {
1316
- description: "Which household member owns the account.",
1317
- allowedValues: ["me", "spouse", "joint"],
1318
- evidence: "ui-label",
1319
- },
1320
- ...EARLY_WITHDRAWAL_FIELDS,
1321
- rmdType: {
1322
- description: "Statutory required minimum distribution regime.",
1323
- allowedValues: ["us", "none"],
1324
- evidence: "ui-label",
1325
- },
1326
- },
1327
- },
1328
- {
1329
- scope: "debts",
1330
- title: "Current Finances: unsecured debts",
1331
- fields: {
1332
- name: { description: "Display label of the debt.", evidence: "ui-label" },
1333
- balance: {
1334
- description: "Outstanding principal of the debt.",
1335
- units: DOLLARS,
1336
- evidence: "ui-label",
1337
- },
1338
- interestRate: {
1339
- description: "Annual percentage rate of the debt.",
1340
- units: PCT,
1341
- evidence: "ui-label",
1342
- },
1343
- monthlyPayment: {
1344
- description: "Minimum monthly payment.",
1345
- units: DOLLARS,
1346
- evidence: "ui-label",
1347
- },
1348
- owner: {
1349
- description: "Which household member owes the debt.",
1350
- allowedValues: ["me", "spouse", "joint"],
1351
- evidence: "ui-label",
1352
- },
1353
- },
1354
- },
1355
541
  ];
1356
542
  function asExportShapeGroup(group) {
1357
543
  const fields = {};
@@ -1366,7 +552,7 @@ function asExportShapeGroup(group) {
1366
552
  const ALIGNMENT_TYPES = ["calendar", "rolling", "au-tax", "uk-tax", "custom"];
1367
553
  const ALIGNMENT_NOTE = '"calendar" runs January to December; "rolling" stores no date and counts plan years from the current month; "au-tax" stores date "2000-07-01" and "uk-tax" stores "2000-04-01"; "custom" stores the chosen starting month as "2000-MM-01". The plan ends on the last day of the plan year that holds the household\'s latest life expectancy, so changing the alignment can add or remove a plan year.';
1368
554
  const ALIGNMENT_DATE_DESCRIPTION = 'Month each plan year starts, as "2000-MM-01"; only the month is meaningful.';
1369
- const VARIABLES_V5_BASE = asExportShapeGroup(DATA_MODEL_GROUPS.find((g) => g.scope === "variables"));
555
+ const VARIABLES_V5_BASE = asExportShapeGroup(PLAN_SETTINGS_GROUPS.find((g) => g.scope === "variables"));
1370
556
  const VARIABLES_V5_GROUP = {
1371
557
  ...VARIABLES_V5_BASE,
1372
558
  fields: {
@@ -1390,8 +576,8 @@ const VARIABLES_V5_GROUP = {
1390
576
  },
1391
577
  },
1392
578
  };
1393
- const MONTECARLO_V5_GROUP = asExportShapeGroup(DATA_MODEL_GROUPS.find((g) => g.scope === "montecarlo"));
1394
- const WITHDRAWAL_STRATEGY_V5_GROUP = asExportShapeGroup(DATA_MODEL_GROUPS.find((g) => g.scope === "withdrawalStrategy"));
579
+ const MONTECARLO_V5_GROUP = asExportShapeGroup(PLAN_SETTINGS_GROUPS.find((g) => g.scope === "montecarlo"));
580
+ const WITHDRAWAL_STRATEGY_V5_GROUP = asExportShapeGroup(PLAN_SETTINGS_GROUPS.find((g) => g.scope === "withdrawalStrategy"));
1395
581
  export const DATA_MODEL_V5_GROUPS = [
1396
582
  {
1397
583
  scope: "envelope",
@@ -2262,8 +1448,7 @@ export const DATA_MODEL_V5_GROUPS = [
2262
1448
  /**
2263
1449
  * On-screen labels in ProjectionLab 5.0.0, keyed by scope then path. Each was
2264
1450
  * found in the app by writing a distinct value to the field, or by matching a
2265
- * stored value to the control that shows it. A label attaches to the entry for
2266
- * its path in every export layout that lists the path.
1451
+ * stored value to the control that shows it.
2267
1452
  */
2268
1453
  const RATES = "Plan Settings > Rates";
2269
1454
  const TAX = "Plan Settings > Tax";
@@ -2431,7 +1616,7 @@ export const UI_LABELS_V5 = {
2431
1616
  },
2432
1617
  };
2433
1618
  for (const [scope, labels] of Object.entries(UI_LABELS_V5)) {
2434
- const groups = [...DATA_MODEL_GROUPS, ...DATA_MODEL_V5_GROUPS].filter((candidate) => candidate.scope === scope);
1619
+ const groups = DATA_MODEL_V5_GROUPS.filter((candidate) => candidate.scope === scope);
2435
1620
  for (const [path, [label, location]] of Object.entries(labels)) {
2436
1621
  const fields = groups.flatMap((group) => group.fields[path] ?? []);
2437
1622
  if (fields.length === 0) {
@@ -2443,21 +1628,13 @@ for (const [scope, labels] of Object.entries(UI_LABELS_V5)) {
2443
1628
  }
2444
1629
  }
2445
1630
  }
2446
- const compiledByScopeV4 = new Map();
2447
- for (const group of DATA_MODEL_GROUPS) {
2448
- const entries = [];
2449
- for (const [pattern, field] of Object.entries(group.fields)) {
2450
- entries.push({ pattern, segments: pattern.split("."), field });
2451
- }
2452
- compiledByScopeV4.set(group.scope, entries);
2453
- }
2454
- const compiledByScopeV5 = new Map();
1631
+ const compiledByScope = new Map();
2455
1632
  for (const group of DATA_MODEL_V5_GROUPS) {
2456
1633
  const entries = [];
2457
1634
  for (const [pattern, field] of Object.entries(group.fields)) {
2458
1635
  entries.push({ pattern, segments: pattern.split("."), field });
2459
1636
  }
2460
- compiledByScopeV5.set(group.scope, entries);
1637
+ compiledByScope.set(group.scope, entries);
2461
1638
  }
2462
1639
  function entryMatches(segments, pathSegments) {
2463
1640
  if (segments.length !== pathSegments.length)
@@ -2468,14 +1645,13 @@ function entryMatches(segments, pathSegments) {
2468
1645
  }
2469
1646
  return true;
2470
1647
  }
2471
- /** Get the data model groups for the specified export layout. */
2472
- export function getDataModelGroups(layout = "v4") {
2473
- return layout === "v5" ? DATA_MODEL_V5_GROUPS : DATA_MODEL_GROUPS;
1648
+ /** The data model groups. */
1649
+ export function getDataModelGroups() {
1650
+ return DATA_MODEL_V5_GROUPS;
2474
1651
  }
2475
1652
  /** Field entry for a scope-prefixed concrete path, or undefined. */
2476
- export function matchDataModelField(scope, path, layout = "v4") {
2477
- const map = layout === "v5" ? compiledByScopeV5 : compiledByScopeV4;
2478
- const entries = map.get(scope);
1653
+ export function matchDataModelField(scope, path) {
1654
+ const entries = compiledByScope.get(scope);
2479
1655
  if (!entries)
2480
1656
  return undefined;
2481
1657
  const exact = entries.find((entry) => entry.pattern === path);
@@ -2506,9 +1682,9 @@ export function enforcesAllowedValues(field) {
2506
1682
  * paths with a registry entry. Entries for unknown paths are returned
2507
1683
  * unchanged, so existing listPaths fields never change.
2508
1684
  */
2509
- export function annotateAddressableValues(scope, values, layout = "v4") {
1685
+ export function annotateAddressableValues(scope, values) {
2510
1686
  return values.map((value) => {
2511
- const field = scope ? matchDataModelField(scope, value.path, layout) : undefined;
1687
+ const field = scope ? matchDataModelField(scope, value.path) : undefined;
2512
1688
  if (!field)
2513
1689
  return value;
2514
1690
  const annotated = { ...value };
@@ -2531,10 +1707,10 @@ export function annotateAddressableValues(scope, values, layout = "v4") {
2531
1707
  * string outside it. undefined when no refusal applies. Numeric and boolean
2532
1708
  * values are never refused; ui-label enums are annotated but not enforced.
2533
1709
  */
2534
- export function refusedEnumChoices(scope, path, value, layout = "v4") {
1710
+ export function refusedEnumChoices(scope, path, value) {
2535
1711
  if (scope === undefined || typeof value !== "string")
2536
1712
  return undefined;
2537
- const field = matchDataModelField(scope, path, layout);
1713
+ const field = matchDataModelField(scope, path);
2538
1714
  if (!field?.allowedValues || !enforcesAllowedValues(field))
2539
1715
  return undefined;
2540
1716
  if (field.allowedValues.includes(value))
@@ -2542,8 +1718,8 @@ export function refusedEnumChoices(scope, path, value, layout = "v4") {
2542
1718
  return field.allowedValues;
2543
1719
  }
2544
1720
  /** Refusal for a value a write sets outside an observed enum's choices. */
2545
- export function enumRefusalError(scope, path, value, layout = "v4") {
2546
- const choices = refusedEnumChoices(scope, path, value, layout);
1721
+ export function enumRefusalError(scope, path, value) {
1722
+ const choices = refusedEnumChoices(scope, path, value);
2547
1723
  if (!choices)
2548
1724
  return undefined;
2549
1725
  const shown = typeof value === "string" ? JSON.stringify(value) : String(value);