@markcolabs/mcp 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +128 -205
- package/dist/index.d.ts +9 -23
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -186
- package/dist/index.js.map +1 -1
- package/package.json +21 -12
- package/dist/disclaimers/ymyl.d.ts +0 -16
- package/dist/disclaimers/ymyl.d.ts.map +0 -1
- package/dist/disclaimers/ymyl.js +0 -20
- package/dist/disclaimers/ymyl.js.map +0 -1
- package/dist/engines/compoundInterest.d.ts +0 -75
- package/dist/engines/compoundInterest.d.ts.map +0 -1
- package/dist/engines/compoundInterest.js +0 -74
- package/dist/engines/compoundInterest.js.map +0 -1
- package/dist/engines/data/federalTax.d.ts +0 -47
- package/dist/engines/data/federalTax.d.ts.map +0 -1
- package/dist/engines/data/federalTax.js +0 -111
- package/dist/engines/data/federalTax.js.map +0 -1
- package/dist/engines/data/irs2026.d.ts +0 -30
- package/dist/engines/data/irs2026.d.ts.map +0 -1
- package/dist/engines/data/irs2026.js +0 -30
- package/dist/engines/data/irs2026.js.map +0 -1
- package/dist/engines/data/ssa.d.ts +0 -39
- package/dist/engines/data/ssa.d.ts.map +0 -1
- package/dist/engines/data/ssa.js +0 -55
- package/dist/engines/data/ssa.js.map +0 -1
- package/dist/engines/mortgage.d.ts +0 -70
- package/dist/engines/mortgage.d.ts.map +0 -1
- package/dist/engines/mortgage.js +0 -60
- package/dist/engines/mortgage.js.map +0 -1
- package/dist/engines/paycheck.d.ts +0 -93
- package/dist/engines/paycheck.d.ts.map +0 -1
- package/dist/engines/paycheck.js +0 -113
- package/dist/engines/paycheck.js.map +0 -1
- package/dist/engines/retirement401k.d.ts +0 -109
- package/dist/engines/retirement401k.d.ts.map +0 -1
- package/dist/engines/retirement401k.js +0 -130
- package/dist/engines/retirement401k.js.map +0 -1
- package/dist/engines/socialSecurity.d.ts +0 -63
- package/dist/engines/socialSecurity.d.ts.map +0 -1
- package/dist/engines/socialSecurity.js +0 -139
- package/dist/engines/socialSecurity.js.map +0 -1
- package/dist/envelope.d.ts +0 -76
- package/dist/envelope.d.ts.map +0 -1
- package/dist/envelope.js +0 -34
- package/dist/envelope.js.map +0 -1
- package/dist/shared/bounds.d.ts +0 -83
- package/dist/shared/bounds.d.ts.map +0 -1
- package/dist/shared/bounds.js +0 -121
- package/dist/shared/bounds.js.map +0 -1
- package/dist/tools/compoundInterest.d.ts +0 -48
- package/dist/tools/compoundInterest.d.ts.map +0 -1
- package/dist/tools/compoundInterest.js +0 -107
- package/dist/tools/compoundInterest.js.map +0 -1
- package/dist/tools/mortgage.d.ts +0 -51
- package/dist/tools/mortgage.d.ts.map +0 -1
- package/dist/tools/mortgage.js +0 -112
- package/dist/tools/mortgage.js.map +0 -1
- package/dist/tools/paycheck.d.ts +0 -54
- package/dist/tools/paycheck.d.ts.map +0 -1
- package/dist/tools/paycheck.js +0 -122
- package/dist/tools/paycheck.js.map +0 -1
- package/dist/tools/retirement401k.d.ts +0 -85
- package/dist/tools/retirement401k.d.ts.map +0 -1
- package/dist/tools/retirement401k.js +0 -141
- package/dist/tools/retirement401k.js.map +0 -1
- package/dist/tools/socialSecurity.d.ts +0 -51
- package/dist/tools/socialSecurity.d.ts.map +0 -1
- package/dist/tools/socialSecurity.js +0 -117
- package/dist/tools/socialSecurity.js.map +0 -1
- package/dist/util/zod-to-json-schema.d.ts +0 -28
- package/dist/util/zod-to-json-schema.d.ts.map +0 -1
- package/dist/util/zod-to-json-schema.js +0 -98
- package/dist/util/zod-to-json-schema.js.map +0 -1
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Self-contained 2026 federal tax data subset for the @markcolabs/mcp
|
|
3
|
-
* package's paycheck engine.
|
|
4
|
-
*
|
|
5
|
-
* Mirrored from site/src/data/annual-limits.js. See engines/data/ssa.ts for the
|
|
6
|
-
* full rationale on the mirror pattern (npm consumers cannot reach site/src/).
|
|
7
|
-
*
|
|
8
|
-
* Filing status keys mirror the paycheck engine's camelCase convention:
|
|
9
|
-
* "single" | "married" | "marriedSeparate" | "headOfHousehold"
|
|
10
|
-
*
|
|
11
|
-
* Source of truth: IRS Rev. Proc. 2025-32 (2026 inflation adjustments).
|
|
12
|
-
* Last verified: 2026-05-09.
|
|
13
|
-
*/
|
|
14
|
-
import { SS_WAGE_BASE } from "./ssa.js";
|
|
15
|
-
/** FICA statutory rates (unchanged since 1990 / ACA 2013). */
|
|
16
|
-
export const FICA_RATES = {
|
|
17
|
-
socialSecurityRate: 0.062,
|
|
18
|
-
medicareRate: 0.0145,
|
|
19
|
-
additionalMedicareRate: 0.009,
|
|
20
|
-
};
|
|
21
|
-
/** Additional Medicare Tax 0.9% kicks in above these wage thresholds (filing-status keyed). */
|
|
22
|
-
export const ADDITIONAL_MEDICARE_THRESHOLDS_2026 = {
|
|
23
|
-
single: 200_000,
|
|
24
|
-
married: 250_000,
|
|
25
|
-
marriedSeparate: 125_000,
|
|
26
|
-
headOfHousehold: 200_000,
|
|
27
|
-
};
|
|
28
|
-
/** 2026 standard deductions (IRS Rev. Proc. 2025-32). */
|
|
29
|
-
export const STANDARD_DEDUCTIONS_2026 = {
|
|
30
|
-
single: 15_750,
|
|
31
|
-
married: 31_500,
|
|
32
|
-
marriedSeparate: 15_750,
|
|
33
|
-
headOfHousehold: 23_625,
|
|
34
|
-
};
|
|
35
|
-
/** Build cumulative `baseTax` for each bracket (used by the Percentage Method). */
|
|
36
|
-
function withBaseTax(brackets) {
|
|
37
|
-
let cumulative = 0;
|
|
38
|
-
return brackets.map((b) => {
|
|
39
|
-
const baseTax = cumulative;
|
|
40
|
-
if (b.max !== null) {
|
|
41
|
-
cumulative += (b.max - b.min) * b.rate;
|
|
42
|
-
}
|
|
43
|
-
return { min: b.min, max: b.max, rate: b.rate, baseTax };
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* 2026 federal tax brackets (IRS Rev. Proc. 2025-32; verified AL-2026-001 S134).
|
|
48
|
-
* Filing-status keyed; values match site/src/data/annual-limits.js TAX_BRACKETS[2026].
|
|
49
|
-
*/
|
|
50
|
-
export const FEDERAL_TAX_BRACKETS_2026 = {
|
|
51
|
-
single: withBaseTax([
|
|
52
|
-
{ min: 0, max: 12_400, rate: 0.10 },
|
|
53
|
-
{ min: 12_400, max: 50_400, rate: 0.12 },
|
|
54
|
-
{ min: 50_400, max: 105_700, rate: 0.22 },
|
|
55
|
-
{ min: 105_700, max: 201_775, rate: 0.24 },
|
|
56
|
-
{ min: 201_775, max: 256_225, rate: 0.32 },
|
|
57
|
-
{ min: 256_225, max: 640_600, rate: 0.35 },
|
|
58
|
-
{ min: 640_600, max: null, rate: 0.37 },
|
|
59
|
-
]),
|
|
60
|
-
married: withBaseTax([
|
|
61
|
-
{ min: 0, max: 24_800, rate: 0.10 },
|
|
62
|
-
{ min: 24_800, max: 100_800, rate: 0.12 },
|
|
63
|
-
{ min: 100_800, max: 211_400, rate: 0.22 },
|
|
64
|
-
{ min: 211_400, max: 403_550, rate: 0.24 },
|
|
65
|
-
{ min: 403_550, max: 512_450, rate: 0.32 },
|
|
66
|
-
{ min: 512_450, max: 768_700, rate: 0.35 },
|
|
67
|
-
{ min: 768_700, max: null, rate: 0.37 },
|
|
68
|
-
]),
|
|
69
|
-
marriedSeparate: withBaseTax([
|
|
70
|
-
{ min: 0, max: 12_400, rate: 0.10 },
|
|
71
|
-
{ min: 12_400, max: 50_400, rate: 0.12 },
|
|
72
|
-
{ min: 50_400, max: 105_700, rate: 0.22 },
|
|
73
|
-
{ min: 105_700, max: 201_775, rate: 0.24 },
|
|
74
|
-
{ min: 201_775, max: 256_225, rate: 0.32 },
|
|
75
|
-
{ min: 256_225, max: 384_350, rate: 0.35 },
|
|
76
|
-
{ min: 384_350, max: null, rate: 0.37 },
|
|
77
|
-
]),
|
|
78
|
-
headOfHousehold: withBaseTax([
|
|
79
|
-
{ min: 0, max: 17_700, rate: 0.10 },
|
|
80
|
-
{ min: 17_700, max: 67_450, rate: 0.12 },
|
|
81
|
-
{ min: 67_450, max: 105_700, rate: 0.22 },
|
|
82
|
-
{ min: 105_700, max: 201_775, rate: 0.24 },
|
|
83
|
-
{ min: 201_775, max: 256_200, rate: 0.32 },
|
|
84
|
-
{ min: 256_200, max: 640_600, rate: 0.35 },
|
|
85
|
-
{ min: 640_600, max: null, rate: 0.37 },
|
|
86
|
-
]),
|
|
87
|
-
};
|
|
88
|
-
/** Pay periods per year. Matches site/src/utils/paycheck-tax-engine.js PAY_PERIODS. */
|
|
89
|
-
export const PAY_PERIODS_PER_YEAR = {
|
|
90
|
-
weekly: 52,
|
|
91
|
-
biweekly: 26,
|
|
92
|
-
semimonthly: 24,
|
|
93
|
-
monthly: 12,
|
|
94
|
-
quarterly: 4,
|
|
95
|
-
annual: 1,
|
|
96
|
-
};
|
|
97
|
-
/** US states with no income tax (paycheck engine NO_TAX_STATES). */
|
|
98
|
-
export const NO_TAX_STATES = [
|
|
99
|
-
"AK",
|
|
100
|
-
"FL",
|
|
101
|
-
"NV",
|
|
102
|
-
"NH",
|
|
103
|
-
"SD",
|
|
104
|
-
"TN",
|
|
105
|
-
"TX",
|
|
106
|
-
"WA",
|
|
107
|
-
"WY",
|
|
108
|
-
];
|
|
109
|
-
/** Re-export SS wage base for paycheck engine (FICA SS cap). */
|
|
110
|
-
export { SS_WAGE_BASE };
|
|
111
|
-
//# sourceMappingURL=federalTax.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"federalTax.js","sourceRoot":"","sources":["../../../src/engines/data/federalTax.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAIxC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,kBAAkB,EAAE,KAAK;IACzB,YAAY,EAAE,MAAM;IACpB,sBAAsB,EAAE,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AACpE,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACI,CAAC;AAIX,gEAAgE;AAChE,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Self-contained 2026 IRS retirement-plan limits subset for the MCP package's
|
|
3
|
-
* 401(k) projection engine.
|
|
4
|
-
*
|
|
5
|
-
* Mirrored from site/src/data/annual-limits.js LIMITS_401K_2026. See
|
|
6
|
-
* engines/data/ssa.ts for full rationale on the mirror pattern.
|
|
7
|
-
*
|
|
8
|
-
* Source: IRS Notice 2025-67 (2026 retirement-plan limits) +
|
|
9
|
-
* SECURE 2.0 Act §109 (super catch-up provision for ages 60-63).
|
|
10
|
-
* Last verified: 2026-05-09.
|
|
11
|
-
*/
|
|
12
|
-
export declare const LIMITS_401K_2026: {
|
|
13
|
-
/** Base employee deferral limit. */
|
|
14
|
-
readonly base: 24500;
|
|
15
|
-
/** Regular catch-up amount for ages 50-59 or 64+. */
|
|
16
|
-
readonly catchUp: 8000;
|
|
17
|
-
/** Super catch-up amount for ages 60-63 (SECURE 2.0). */
|
|
18
|
-
readonly superCatchUp: 11250;
|
|
19
|
-
/** Total deferral limit with regular catch-up. */
|
|
20
|
-
readonly totalWithCatchUp: 32500;
|
|
21
|
-
/** Total deferral limit with super catch-up. */
|
|
22
|
-
readonly totalWithSuperCatchUp: 35750;
|
|
23
|
-
/** Minimum age for any catch-up. */
|
|
24
|
-
readonly catchUpAge: 50;
|
|
25
|
-
/** Start of super catch-up window. */
|
|
26
|
-
readonly superCatchUpAgeStart: 60;
|
|
27
|
-
/** End of super catch-up window. */
|
|
28
|
-
readonly superCatchUpAgeEnd: 63;
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=irs2026.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"irs2026.d.ts","sourceRoot":"","sources":["../../../src/engines/data/irs2026.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,gBAAgB;IAC3B,oCAAoC;;IAEpC,qDAAqD;;IAErD,yDAAyD;;IAEzD,kDAAkD;;IAElD,gDAAgD;;IAEhD,oCAAoC;;IAEpC,sCAAsC;;IAEtC,oCAAoC;;CAE5B,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Self-contained 2026 IRS retirement-plan limits subset for the MCP package's
|
|
3
|
-
* 401(k) projection engine.
|
|
4
|
-
*
|
|
5
|
-
* Mirrored from site/src/data/annual-limits.js LIMITS_401K_2026. See
|
|
6
|
-
* engines/data/ssa.ts for full rationale on the mirror pattern.
|
|
7
|
-
*
|
|
8
|
-
* Source: IRS Notice 2025-67 (2026 retirement-plan limits) +
|
|
9
|
-
* SECURE 2.0 Act §109 (super catch-up provision for ages 60-63).
|
|
10
|
-
* Last verified: 2026-05-09.
|
|
11
|
-
*/
|
|
12
|
-
export const LIMITS_401K_2026 = {
|
|
13
|
-
/** Base employee deferral limit. */
|
|
14
|
-
base: 24_500,
|
|
15
|
-
/** Regular catch-up amount for ages 50-59 or 64+. */
|
|
16
|
-
catchUp: 8_000,
|
|
17
|
-
/** Super catch-up amount for ages 60-63 (SECURE 2.0). */
|
|
18
|
-
superCatchUp: 11_250,
|
|
19
|
-
/** Total deferral limit with regular catch-up. */
|
|
20
|
-
totalWithCatchUp: 32_500,
|
|
21
|
-
/** Total deferral limit with super catch-up. */
|
|
22
|
-
totalWithSuperCatchUp: 35_750,
|
|
23
|
-
/** Minimum age for any catch-up. */
|
|
24
|
-
catchUpAge: 50,
|
|
25
|
-
/** Start of super catch-up window. */
|
|
26
|
-
superCatchUpAgeStart: 60,
|
|
27
|
-
/** End of super catch-up window. */
|
|
28
|
-
superCatchUpAgeEnd: 63,
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=irs2026.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"irs2026.js","sourceRoot":"","sources":["../../../src/engines/data/irs2026.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,oCAAoC;IACpC,IAAI,EAAE,MAAM;IACZ,qDAAqD;IACrD,OAAO,EAAE,KAAK;IACd,yDAAyD;IACzD,YAAY,EAAE,MAAM;IACpB,kDAAkD;IAClD,gBAAgB,EAAE,MAAM;IACxB,gDAAgD;IAChD,qBAAqB,EAAE,MAAM;IAC7B,oCAAoC;IACpC,UAAU,EAAE,EAAE;IACd,sCAAsC;IACtC,oBAAoB,EAAE,EAAE;IACxB,oCAAoC;IACpC,kBAAkB,EAAE,EAAE;CACd,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Self-contained SSA constants subset for the @markcolabs/mcp package.
|
|
3
|
-
*
|
|
4
|
-
* Mirrored from site/src/data/annual-limits.js and site/src/utils/social-security-engine.js
|
|
5
|
-
* (re-export-of-truth pattern). Per ADR-0039 § 5 + S136 kickoff: the npm-published
|
|
6
|
-
* MCP package may NOT import from site/src/ at runtime, so the regulatory data
|
|
7
|
-
* subset that the SS engine depends on is mirrored here. When site values change,
|
|
8
|
-
* update this file in lockstep with the source and bump the SS engine ENGINE_VERSION.
|
|
9
|
-
*
|
|
10
|
-
* Source of truth: site/src/data/annual-limits.js
|
|
11
|
-
* - SSA_BEND_POINTS keyed by eligibility year (year a person turns 62)
|
|
12
|
-
* - SS_WAGE_BASE keyed by calendar year (max earnings subject to SS tax)
|
|
13
|
-
* Source: SSA Fact Sheet, https://www.ssa.gov/oact/cola/cbb.html
|
|
14
|
-
* SSA Bend Points history, https://www.ssa.gov/oact/cola/bendpoints.html
|
|
15
|
-
*
|
|
16
|
-
* Last verified: 2026-05-09 (matches site annual-limits.js verification dates).
|
|
17
|
-
*/
|
|
18
|
-
/**
|
|
19
|
-
* Average Wage Indexing series bend points by eligibility year.
|
|
20
|
-
* Eligibility year = year person turns 62.
|
|
21
|
-
*
|
|
22
|
-
* Subset includes 2014–2026; older years are not needed for current users
|
|
23
|
-
* (someone born in 1952 turned 62 in 2014; older birthdays use even-older bend
|
|
24
|
-
* points but the SS engine accepts anything in the lookup, falling back to the
|
|
25
|
-
* latest available year with `estimated: true`).
|
|
26
|
-
*/
|
|
27
|
-
export declare const SSA_BEND_POINTS: Record<number, {
|
|
28
|
-
first: number;
|
|
29
|
-
second: number;
|
|
30
|
-
}>;
|
|
31
|
-
/**
|
|
32
|
-
* Social Security wage base by calendar year (max earnings subject to SS tax).
|
|
33
|
-
*/
|
|
34
|
-
export declare const SS_WAGE_BASE: Record<number, number>;
|
|
35
|
-
/**
|
|
36
|
-
* Default life expectancy used by lifetime-benefit projections (SSA actuarial table proxy).
|
|
37
|
-
*/
|
|
38
|
-
export declare const DEFAULT_LIFE_EXPECTANCY = 85;
|
|
39
|
-
//# sourceMappingURL=ssa.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ssa.d.ts","sourceRoot":"","sources":["../../../src/engines/data/ssa.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAc7E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAK/C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,KAAK,CAAC"}
|
package/dist/engines/data/ssa.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Self-contained SSA constants subset for the @markcolabs/mcp package.
|
|
3
|
-
*
|
|
4
|
-
* Mirrored from site/src/data/annual-limits.js and site/src/utils/social-security-engine.js
|
|
5
|
-
* (re-export-of-truth pattern). Per ADR-0039 § 5 + S136 kickoff: the npm-published
|
|
6
|
-
* MCP package may NOT import from site/src/ at runtime, so the regulatory data
|
|
7
|
-
* subset that the SS engine depends on is mirrored here. When site values change,
|
|
8
|
-
* update this file in lockstep with the source and bump the SS engine ENGINE_VERSION.
|
|
9
|
-
*
|
|
10
|
-
* Source of truth: site/src/data/annual-limits.js
|
|
11
|
-
* - SSA_BEND_POINTS keyed by eligibility year (year a person turns 62)
|
|
12
|
-
* - SS_WAGE_BASE keyed by calendar year (max earnings subject to SS tax)
|
|
13
|
-
* Source: SSA Fact Sheet, https://www.ssa.gov/oact/cola/cbb.html
|
|
14
|
-
* SSA Bend Points history, https://www.ssa.gov/oact/cola/bendpoints.html
|
|
15
|
-
*
|
|
16
|
-
* Last verified: 2026-05-09 (matches site annual-limits.js verification dates).
|
|
17
|
-
*/
|
|
18
|
-
/**
|
|
19
|
-
* Average Wage Indexing series bend points by eligibility year.
|
|
20
|
-
* Eligibility year = year person turns 62.
|
|
21
|
-
*
|
|
22
|
-
* Subset includes 2014–2026; older years are not needed for current users
|
|
23
|
-
* (someone born in 1952 turned 62 in 2014; older birthdays use even-older bend
|
|
24
|
-
* points but the SS engine accepts anything in the lookup, falling back to the
|
|
25
|
-
* latest available year with `estimated: true`).
|
|
26
|
-
*/
|
|
27
|
-
export const SSA_BEND_POINTS = {
|
|
28
|
-
2014: { first: 816, second: 4917 },
|
|
29
|
-
2015: { first: 826, second: 4980 },
|
|
30
|
-
2016: { first: 856, second: 5157 },
|
|
31
|
-
2017: { first: 885, second: 5336 },
|
|
32
|
-
2018: { first: 895, second: 5397 },
|
|
33
|
-
2019: { first: 926, second: 5583 },
|
|
34
|
-
2020: { first: 960, second: 5785 },
|
|
35
|
-
2021: { first: 996, second: 6002 },
|
|
36
|
-
2022: { first: 1024, second: 6172 },
|
|
37
|
-
2023: { first: 1115, second: 6721 },
|
|
38
|
-
2024: { first: 1174, second: 7078 },
|
|
39
|
-
2025: { first: 1226, second: 7391 },
|
|
40
|
-
2026: { first: 1286, second: 7749 },
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Social Security wage base by calendar year (max earnings subject to SS tax).
|
|
44
|
-
*/
|
|
45
|
-
export const SS_WAGE_BASE = {
|
|
46
|
-
2025: 176_100,
|
|
47
|
-
2026: 176_100, // SSA Fact Sheet 2026 (verified AL-2026-001, S134)
|
|
48
|
-
2027: 180_000, // Projected
|
|
49
|
-
2028: 184_000, // Projected
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Default life expectancy used by lifetime-benefit projections (SSA actuarial table proxy).
|
|
53
|
-
*/
|
|
54
|
-
export const DEFAULT_LIFE_EXPECTANCY = 85;
|
|
55
|
-
//# sourceMappingURL=ssa.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ssa.js","sourceRoot":"","sources":["../../../src/engines/data/ssa.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,eAAe,GAAsD;IAChF,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE;IAClC,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE;IAClC,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE;IAClC,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE;IAClC,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE;IAClC,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE;IAClC,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE;IAClC,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE;IAClC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;IACnC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;IACnC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;IACnC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;IACnC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;CACpC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAA2B;IAClD,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO,EAAE,mDAAmD;IAClE,IAAI,EAAE,OAAO,EAAE,YAAY;IAC3B,IAAI,EAAE,OAAO,EAAE,YAAY;CAC5B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mortgage engine — lifted from site/src/pages/mortgage-calculator/mortgage-calculator.js
|
|
3
|
-
* (function `calculateMonthlyPI`).
|
|
4
|
-
*
|
|
5
|
-
* Per ADR-0039 § 5 (Calc-Engine Lift Pattern):
|
|
6
|
-
* - Pure synchronous functions of inputs → results. No DOM, no fetch.
|
|
7
|
-
* - ENGINE_VERSION bumps when math changes (semver).
|
|
8
|
-
* - Parity tests at packages/mcp/test/parity/mortgage.test.ts gate this engine
|
|
9
|
-
* against the source site calculator JS to the cent.
|
|
10
|
-
*
|
|
11
|
-
* Math reference (standard amortization formula):
|
|
12
|
-
* M = P * [r(1+r)^n] / [(1+r)^n - 1]
|
|
13
|
-
* where:
|
|
14
|
-
* M = monthly payment
|
|
15
|
-
* P = principal (loan amount)
|
|
16
|
-
* r = monthly interest rate (annual / 12, as decimal)
|
|
17
|
-
* n = number of monthly payments (years * 12)
|
|
18
|
-
*
|
|
19
|
-
* For 0% rate the formula reduces to: M = P / n
|
|
20
|
-
*/
|
|
21
|
-
/**
|
|
22
|
-
* SemVer of the mortgage engine math. Per ADR-0039 § 5 (reaffirmed in
|
|
23
|
-
* ADR-0041 Position #4a): major bump = math change; minor = additive output;
|
|
24
|
-
* patch = numerical correction. NOT bumped for cosmetic refactors.
|
|
25
|
-
* - 0.1.0: initial v1 lift from mortgage-calculator.js (Sprint 135 Item 5).
|
|
26
|
-
* - 0.2.0 (v0.1.0 publish): out-of-policy package-surface bump — superseded.
|
|
27
|
-
* - 1.0.0 (v0.2.0 publish): one-time reset to align with ADR-0039 § 5 semantics
|
|
28
|
-
* per ADR-0041 D4a. Math is unchanged from 0.1.0 / 0.2.0.
|
|
29
|
-
*/
|
|
30
|
-
export declare const ENGINE_VERSION = "1.0.0";
|
|
31
|
-
/**
|
|
32
|
-
* Inputs to the mortgage monthly-payment engine.
|
|
33
|
-
*
|
|
34
|
-
* Per ADR-0039 § 2:
|
|
35
|
-
* - Monetary fields are bare USD numbers.
|
|
36
|
-
* - Percentage fields use whole-number-percent units (e.g., 6.5 for 6.5%).
|
|
37
|
-
*
|
|
38
|
-
* NOTE on convention vs. sprint prompt: the sprint prompt referenced
|
|
39
|
-
* decimal-rate inputs (0.065). ADR-0039 § 2 locks the `Percent` suffix +
|
|
40
|
-
* whole-number-percent convention. The contract wins; this engine accepts
|
|
41
|
-
* `annualRatePercent` (e.g., 6.5).
|
|
42
|
-
*/
|
|
43
|
-
export interface MortgageMonthlyPaymentInput {
|
|
44
|
-
/** Principal loan amount in USD. */
|
|
45
|
-
principal: number;
|
|
46
|
-
/** Annual interest rate as whole-number percent (e.g., 6.5 for 6.5%). */
|
|
47
|
-
annualRatePercent: number;
|
|
48
|
-
/** Loan term in years. Must be a positive integer. */
|
|
49
|
-
termYears: number;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Result payload (what goes inside ToolResult.result).
|
|
53
|
-
*/
|
|
54
|
-
export interface MortgageMonthlyPaymentResult {
|
|
55
|
-
/** Monthly principal & interest payment, in USD. */
|
|
56
|
-
monthlyPayment: number;
|
|
57
|
-
/** Total interest paid over the life of the loan, in USD. */
|
|
58
|
-
totalInterest: number;
|
|
59
|
-
/** Total paid (principal + interest) over the life of the loan, in USD. */
|
|
60
|
-
totalPaid: number;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Compute the monthly principal & interest payment.
|
|
64
|
-
*
|
|
65
|
-
* 1-to-1 port of site/src/pages/mortgage-calculator/mortgage-calculator.js
|
|
66
|
-
* function `calculateMonthlyPI`. Same math, same edge case handling
|
|
67
|
-
* (0% rate → straight-line amortization).
|
|
68
|
-
*/
|
|
69
|
-
export declare function monthlyPayment(input: MortgageMonthlyPaymentInput): MortgageMonthlyPaymentResult;
|
|
70
|
-
//# sourceMappingURL=mortgage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mortgage.d.ts","sourceRoot":"","sources":["../../src/engines/mortgage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,UAAU,CAAC;AAEtC;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,2BAA2B;IAC1C,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,iBAAiB,EAAE,MAAM,CAAC;IAC1B,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,oDAAoD;IACpD,cAAc,EAAE,MAAM,CAAC;IACvB,6DAA6D;IAC7D,aAAa,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,2BAA2B,GACjC,4BAA4B,CAwB9B"}
|
package/dist/engines/mortgage.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mortgage engine — lifted from site/src/pages/mortgage-calculator/mortgage-calculator.js
|
|
3
|
-
* (function `calculateMonthlyPI`).
|
|
4
|
-
*
|
|
5
|
-
* Per ADR-0039 § 5 (Calc-Engine Lift Pattern):
|
|
6
|
-
* - Pure synchronous functions of inputs → results. No DOM, no fetch.
|
|
7
|
-
* - ENGINE_VERSION bumps when math changes (semver).
|
|
8
|
-
* - Parity tests at packages/mcp/test/parity/mortgage.test.ts gate this engine
|
|
9
|
-
* against the source site calculator JS to the cent.
|
|
10
|
-
*
|
|
11
|
-
* Math reference (standard amortization formula):
|
|
12
|
-
* M = P * [r(1+r)^n] / [(1+r)^n - 1]
|
|
13
|
-
* where:
|
|
14
|
-
* M = monthly payment
|
|
15
|
-
* P = principal (loan amount)
|
|
16
|
-
* r = monthly interest rate (annual / 12, as decimal)
|
|
17
|
-
* n = number of monthly payments (years * 12)
|
|
18
|
-
*
|
|
19
|
-
* For 0% rate the formula reduces to: M = P / n
|
|
20
|
-
*/
|
|
21
|
-
/**
|
|
22
|
-
* SemVer of the mortgage engine math. Per ADR-0039 § 5 (reaffirmed in
|
|
23
|
-
* ADR-0041 Position #4a): major bump = math change; minor = additive output;
|
|
24
|
-
* patch = numerical correction. NOT bumped for cosmetic refactors.
|
|
25
|
-
* - 0.1.0: initial v1 lift from mortgage-calculator.js (Sprint 135 Item 5).
|
|
26
|
-
* - 0.2.0 (v0.1.0 publish): out-of-policy package-surface bump — superseded.
|
|
27
|
-
* - 1.0.0 (v0.2.0 publish): one-time reset to align with ADR-0039 § 5 semantics
|
|
28
|
-
* per ADR-0041 D4a. Math is unchanged from 0.1.0 / 0.2.0.
|
|
29
|
-
*/
|
|
30
|
-
export const ENGINE_VERSION = "1.0.0";
|
|
31
|
-
/**
|
|
32
|
-
* Compute the monthly principal & interest payment.
|
|
33
|
-
*
|
|
34
|
-
* 1-to-1 port of site/src/pages/mortgage-calculator/mortgage-calculator.js
|
|
35
|
-
* function `calculateMonthlyPI`. Same math, same edge case handling
|
|
36
|
-
* (0% rate → straight-line amortization).
|
|
37
|
-
*/
|
|
38
|
-
export function monthlyPayment(input) {
|
|
39
|
-
const { principal, annualRatePercent, termYears } = input;
|
|
40
|
-
const monthlyRate = annualRatePercent / 100 / 12;
|
|
41
|
-
const numPayments = termYears * 12;
|
|
42
|
-
let monthly;
|
|
43
|
-
if (annualRatePercent === 0) {
|
|
44
|
-
monthly = principal / numPayments;
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
monthly =
|
|
48
|
-
principal *
|
|
49
|
-
((monthlyRate * Math.pow(1 + monthlyRate, numPayments)) /
|
|
50
|
-
(Math.pow(1 + monthlyRate, numPayments) - 1));
|
|
51
|
-
}
|
|
52
|
-
const totalPaid = monthly * numPayments;
|
|
53
|
-
const totalInterest = totalPaid - principal;
|
|
54
|
-
return {
|
|
55
|
-
monthlyPayment: monthly,
|
|
56
|
-
totalInterest,
|
|
57
|
-
totalPaid,
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=mortgage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mortgage.js","sourceRoot":"","sources":["../../src/engines/mortgage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC;AAmCtC;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC5B,KAAkC;IAElC,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAE1D,MAAM,WAAW,GAAG,iBAAiB,GAAG,GAAG,GAAG,EAAE,CAAC;IACjD,MAAM,WAAW,GAAG,SAAS,GAAG,EAAE,CAAC;IAEnC,IAAI,OAAe,CAAC;IACpB,IAAI,iBAAiB,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;IACpC,CAAC;SAAM,CAAC;QACN,OAAO;YACL,SAAS;gBACT,CAAC,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,WAAW,EAAE,WAAW,CAAC,CAAC;oBACrD,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,WAAW,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,SAAS,GAAG,OAAO,GAAG,WAAW,CAAC;IACxC,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,CAAC;IAE5C,OAAO;QACL,cAAc,EAAE,OAAO;QACvB,aAAa;QACb,SAAS;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Paycheck net-pay engine — lifted from
|
|
3
|
-
* site/src/utils/paycheck-tax-engine.js (functions `calculateBracketTax`,
|
|
4
|
-
* `calculateFederalWithholding`, `calculateFICA`).
|
|
5
|
-
*
|
|
6
|
-
* Per ADR-0039 § 5: pure synchronous functions, ENGINE_VERSION constant,
|
|
7
|
-
* parity test against the site source as the gate.
|
|
8
|
-
*
|
|
9
|
-
* MCP-side scope decision (S136): the site engine includes per-state tax
|
|
10
|
-
* tables loaded async via fetch(), SDI, NYC local tax, hourly-mode handling,
|
|
11
|
-
* and YTD wage tracking. None of those fit a synchronous, self-contained
|
|
12
|
-
* MCP tool. The v0.2.0 paycheck engine therefore covers:
|
|
13
|
-
* - Federal income-tax withholding (Percentage Method, IRS Pub 15-T 2026)
|
|
14
|
-
* - FICA (SS 6.2% + Medicare 1.45% + Additional Medicare 0.9%)
|
|
15
|
-
* - State estimate: $0 for no-tax states, otherwise a flat 5% estimate
|
|
16
|
-
* (clearly disclaimed as an approximation pending a future stateful tool).
|
|
17
|
-
* - Pre-tax + post-tax deductions on an annualized basis
|
|
18
|
-
*
|
|
19
|
-
* The state-tax limitation is documented in the tool envelope and disclaimer.
|
|
20
|
-
*
|
|
21
|
-
* Math reference (annualized):
|
|
22
|
-
* federalTaxableIncome = max(0, grossAnnual − preTaxAnnual − stdDeduction)
|
|
23
|
-
* federalTax = bracketsLookup(federalTaxableIncome, brackets[filingStatus])
|
|
24
|
-
* ssTax = min(grossAnnual − preTaxAnnual, ssWageBase) * 0.062
|
|
25
|
-
* medicare = (grossAnnual − preTaxAnnual) * 0.0145
|
|
26
|
-
* addlMed = max(0, grossAnnual − addlMedThreshold[filingStatus]) * 0.009
|
|
27
|
-
* stateTax = noTaxState ? 0 : (grossAnnual − preTaxAnnual − stdDeduction) * 0.05
|
|
28
|
-
* netAnnual = grossAnnual − preTaxAnnual − federalTax − ficaTax − stateTax − postTaxAnnual
|
|
29
|
-
* per-paycheck values = annual / payPeriodsPerYear
|
|
30
|
-
*/
|
|
31
|
-
import { type FilingStatus, type PayFrequencyLabel } from "./data/federalTax.js";
|
|
32
|
-
/**
|
|
33
|
-
* SemVer of the paycheck engine. Per ADR-0039 § 5 (reaffirmed in ADR-0041 Position #4a):
|
|
34
|
-
* major bump = math change; minor = additive output; patch = numerical correction.
|
|
35
|
-
* NOT bumped for cosmetic refactors.
|
|
36
|
-
* - 0.2.0 (v0.1.0 publish): initial port (S136), shipped under out-of-policy package-surface version.
|
|
37
|
-
* - 1.0.0 (v0.2.0 publish): one-time reset to align with ADR-0039 § 5 per ADR-0041 D4a.
|
|
38
|
-
* Math unchanged.
|
|
39
|
-
*/
|
|
40
|
-
export declare const ENGINE_VERSION = "1.0.0";
|
|
41
|
-
/** Inputs to the paycheck net-pay engine. */
|
|
42
|
-
export interface PaycheckNetPayInput {
|
|
43
|
-
/** Gross annual salary, USD. */
|
|
44
|
-
grossAnnualSalary: number;
|
|
45
|
-
/** Pay frequency. */
|
|
46
|
-
payFrequency: PayFrequencyLabel;
|
|
47
|
-
/** Federal filing status (camelCase, matches paycheck engine). */
|
|
48
|
-
federalFilingStatus: FilingStatus;
|
|
49
|
-
/** Two-letter state code (e.g., "CA", "TX"). */
|
|
50
|
-
state: string;
|
|
51
|
-
/** Number of dependents claimed. */
|
|
52
|
-
dependents: number;
|
|
53
|
-
/** Total pre-tax deductions (401k, HSA, FSA, etc.) per year, USD. */
|
|
54
|
-
preTaxDeductionsAnnual: number;
|
|
55
|
-
/** Total post-tax deductions (Roth contributions, garnishments, etc.) per year, USD. */
|
|
56
|
-
postTaxDeductionsAnnual: number;
|
|
57
|
-
}
|
|
58
|
-
/** Result payload returned by the engine. */
|
|
59
|
-
export interface PaycheckNetPayResult {
|
|
60
|
-
/** Gross pay per paycheck, USD. */
|
|
61
|
-
grossPerPaycheck: number;
|
|
62
|
-
/** Federal income-tax withholding per paycheck, USD. */
|
|
63
|
-
federalTax: number;
|
|
64
|
-
/** Total FICA per paycheck (SS + Medicare + Additional Medicare), USD. */
|
|
65
|
-
ficaTax: number;
|
|
66
|
-
/** State-tax estimate per paycheck, USD. */
|
|
67
|
-
stateTax: number;
|
|
68
|
-
/** Net pay per paycheck, USD. */
|
|
69
|
-
netPay: number;
|
|
70
|
-
/** Number of pay periods per year. */
|
|
71
|
-
payPeriodsPerYear: number;
|
|
72
|
-
/** Annualized federal tax, USD. */
|
|
73
|
-
federalTaxAnnual: number;
|
|
74
|
-
/** Annualized FICA, USD. */
|
|
75
|
-
ficaTaxAnnual: number;
|
|
76
|
-
/** Annualized state tax estimate, USD. */
|
|
77
|
-
stateTaxAnnual: number;
|
|
78
|
-
/** Annualized net pay, USD. */
|
|
79
|
-
netPayAnnual: number;
|
|
80
|
-
/** Whether the state has no income tax. */
|
|
81
|
-
noStateIncomeTax: boolean;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Compute net pay (and the annualized + per-paycheck breakdown).
|
|
85
|
-
*
|
|
86
|
-
* Implementation note: dependents currently has no effect under the simplified
|
|
87
|
-
* 2026 federal Percentage Method (the site engine likewise doesn't apply
|
|
88
|
-
* dependent credits in the per-paycheck calc). The field is part of the
|
|
89
|
-
* contract for forward compatibility (Form W-4 line 3 dependents credit may be
|
|
90
|
-
* added in a later engine version).
|
|
91
|
-
*/
|
|
92
|
-
export declare function netPay(input: PaycheckNetPayInput): PaycheckNetPayResult;
|
|
93
|
-
//# sourceMappingURL=paycheck.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"paycheck.d.ts","sourceRoot":"","sources":["../../src/engines/paycheck.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAQL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EAEvB,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,UAAU,CAAC;AAEtC,6CAA6C;AAC7C,MAAM,WAAW,mBAAmB;IAClC,gCAAgC;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB;IACrB,YAAY,EAAE,iBAAiB,CAAC;IAChC,kEAAkE;IAClE,mBAAmB,EAAE,YAAY,CAAC;IAClC,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,sBAAsB,EAAE,MAAM,CAAC;IAC/B,wFAAwF;IACxF,uBAAuB,EAAE,MAAM,CAAC;CACjC;AAED,6CAA6C;AAC7C,MAAM,WAAW,oBAAoB;IACnC,mCAAmC;IACnC,gBAAgB,EAAE,MAAM,CAAC;IACzB,wDAAwD;IACxD,UAAU,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mCAAmC;IACnC,gBAAgB,EAAE,MAAM,CAAC;IACzB,4BAA4B;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,0CAA0C;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB,+BAA+B;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAmBD;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,mBAAmB,GAAG,oBAAoB,CAoEvE"}
|
package/dist/engines/paycheck.js
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Paycheck net-pay engine — lifted from
|
|
3
|
-
* site/src/utils/paycheck-tax-engine.js (functions `calculateBracketTax`,
|
|
4
|
-
* `calculateFederalWithholding`, `calculateFICA`).
|
|
5
|
-
*
|
|
6
|
-
* Per ADR-0039 § 5: pure synchronous functions, ENGINE_VERSION constant,
|
|
7
|
-
* parity test against the site source as the gate.
|
|
8
|
-
*
|
|
9
|
-
* MCP-side scope decision (S136): the site engine includes per-state tax
|
|
10
|
-
* tables loaded async via fetch(), SDI, NYC local tax, hourly-mode handling,
|
|
11
|
-
* and YTD wage tracking. None of those fit a synchronous, self-contained
|
|
12
|
-
* MCP tool. The v0.2.0 paycheck engine therefore covers:
|
|
13
|
-
* - Federal income-tax withholding (Percentage Method, IRS Pub 15-T 2026)
|
|
14
|
-
* - FICA (SS 6.2% + Medicare 1.45% + Additional Medicare 0.9%)
|
|
15
|
-
* - State estimate: $0 for no-tax states, otherwise a flat 5% estimate
|
|
16
|
-
* (clearly disclaimed as an approximation pending a future stateful tool).
|
|
17
|
-
* - Pre-tax + post-tax deductions on an annualized basis
|
|
18
|
-
*
|
|
19
|
-
* The state-tax limitation is documented in the tool envelope and disclaimer.
|
|
20
|
-
*
|
|
21
|
-
* Math reference (annualized):
|
|
22
|
-
* federalTaxableIncome = max(0, grossAnnual − preTaxAnnual − stdDeduction)
|
|
23
|
-
* federalTax = bracketsLookup(federalTaxableIncome, brackets[filingStatus])
|
|
24
|
-
* ssTax = min(grossAnnual − preTaxAnnual, ssWageBase) * 0.062
|
|
25
|
-
* medicare = (grossAnnual − preTaxAnnual) * 0.0145
|
|
26
|
-
* addlMed = max(0, grossAnnual − addlMedThreshold[filingStatus]) * 0.009
|
|
27
|
-
* stateTax = noTaxState ? 0 : (grossAnnual − preTaxAnnual − stdDeduction) * 0.05
|
|
28
|
-
* netAnnual = grossAnnual − preTaxAnnual − federalTax − ficaTax − stateTax − postTaxAnnual
|
|
29
|
-
* per-paycheck values = annual / payPeriodsPerYear
|
|
30
|
-
*/
|
|
31
|
-
import { FEDERAL_TAX_BRACKETS_2026, STANDARD_DEDUCTIONS_2026, ADDITIONAL_MEDICARE_THRESHOLDS_2026, FICA_RATES, SS_WAGE_BASE, PAY_PERIODS_PER_YEAR, NO_TAX_STATES, } from "./data/federalTax.js";
|
|
32
|
-
/**
|
|
33
|
-
* SemVer of the paycheck engine. Per ADR-0039 § 5 (reaffirmed in ADR-0041 Position #4a):
|
|
34
|
-
* major bump = math change; minor = additive output; patch = numerical correction.
|
|
35
|
-
* NOT bumped for cosmetic refactors.
|
|
36
|
-
* - 0.2.0 (v0.1.0 publish): initial port (S136), shipped under out-of-policy package-surface version.
|
|
37
|
-
* - 1.0.0 (v0.2.0 publish): one-time reset to align with ADR-0039 § 5 per ADR-0041 D4a.
|
|
38
|
-
* Math unchanged.
|
|
39
|
-
*/
|
|
40
|
-
export const ENGINE_VERSION = "1.0.0";
|
|
41
|
-
const ROUND = (v) => Math.round(v * 100) / 100;
|
|
42
|
-
/**
|
|
43
|
-
* Progressive bracket lookup — verbatim port of site `calculateBracketTax`.
|
|
44
|
-
*/
|
|
45
|
-
function bracketTax(taxableIncome, brackets) {
|
|
46
|
-
if (!brackets.length || taxableIncome <= 0)
|
|
47
|
-
return 0;
|
|
48
|
-
for (let i = brackets.length - 1; i >= 0; i--) {
|
|
49
|
-
const b = brackets[i];
|
|
50
|
-
if (taxableIncome > b.min) {
|
|
51
|
-
const taxableInBracket = taxableIncome - b.min;
|
|
52
|
-
return b.baseTax + taxableInBracket * b.rate;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return 0;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Compute net pay (and the annualized + per-paycheck breakdown).
|
|
59
|
-
*
|
|
60
|
-
* Implementation note: dependents currently has no effect under the simplified
|
|
61
|
-
* 2026 federal Percentage Method (the site engine likewise doesn't apply
|
|
62
|
-
* dependent credits in the per-paycheck calc). The field is part of the
|
|
63
|
-
* contract for forward compatibility (Form W-4 line 3 dependents credit may be
|
|
64
|
-
* added in a later engine version).
|
|
65
|
-
*/
|
|
66
|
-
export function netPay(input) {
|
|
67
|
-
const { grossAnnualSalary, payFrequency, federalFilingStatus, state, preTaxDeductionsAnnual, postTaxDeductionsAnnual, } = input;
|
|
68
|
-
const periodsPerYear = PAY_PERIODS_PER_YEAR[payFrequency];
|
|
69
|
-
// Annual basis after pre-tax deductions (income-tax-reducible).
|
|
70
|
-
const adjustedAnnual = Math.max(0, grossAnnualSalary - preTaxDeductionsAnnual);
|
|
71
|
-
// Federal: standard deduction → taxable income → bracket lookup.
|
|
72
|
-
const stdDeduction = STANDARD_DEDUCTIONS_2026[federalFilingStatus];
|
|
73
|
-
const federalTaxable = Math.max(0, adjustedAnnual - stdDeduction);
|
|
74
|
-
const federalTaxAnnual = bracketTax(federalTaxable, FEDERAL_TAX_BRACKETS_2026[federalFilingStatus]);
|
|
75
|
-
// FICA on gross (less pre-tax cafeteria plan deductions; we conservatively
|
|
76
|
-
// apply pre-tax deductions to FICA since the kickoff input doesn't split
|
|
77
|
-
// 401k vs cafeteria-plan deductions — matches the more lenient employee view).
|
|
78
|
-
const ficaWages = adjustedAnnual;
|
|
79
|
-
const ssWageBase = SS_WAGE_BASE[2026] ?? SS_WAGE_BASE[2025];
|
|
80
|
-
const ssTaxAnnual = Math.min(ficaWages, ssWageBase) * FICA_RATES.socialSecurityRate;
|
|
81
|
-
const medicareAnnual = ficaWages * FICA_RATES.medicareRate;
|
|
82
|
-
const addlMedThreshold = ADDITIONAL_MEDICARE_THRESHOLDS_2026[federalFilingStatus];
|
|
83
|
-
const addlMedAnnual = grossAnnualSalary > addlMedThreshold
|
|
84
|
-
? (grossAnnualSalary - addlMedThreshold) * FICA_RATES.additionalMedicareRate
|
|
85
|
-
: 0;
|
|
86
|
-
const ficaTaxAnnual = ssTaxAnnual + medicareAnnual + addlMedAnnual;
|
|
87
|
-
// State tax: no-tax states explicit zero; everyone else gets a flat 5%
|
|
88
|
-
// estimate over taxable income (clearly disclaimed in the envelope).
|
|
89
|
-
const stateUpper = state.trim().toUpperCase();
|
|
90
|
-
const noStateIncomeTax = NO_TAX_STATES.includes(stateUpper);
|
|
91
|
-
const stateTaxAnnual = noStateIncomeTax ? 0 : federalTaxable * 0.05;
|
|
92
|
-
// Net annual + per-paycheck.
|
|
93
|
-
const netPayAnnual = grossAnnualSalary -
|
|
94
|
-
preTaxDeductionsAnnual -
|
|
95
|
-
federalTaxAnnual -
|
|
96
|
-
ficaTaxAnnual -
|
|
97
|
-
stateTaxAnnual -
|
|
98
|
-
postTaxDeductionsAnnual;
|
|
99
|
-
return {
|
|
100
|
-
grossPerPaycheck: ROUND(grossAnnualSalary / periodsPerYear),
|
|
101
|
-
federalTax: ROUND(federalTaxAnnual / periodsPerYear),
|
|
102
|
-
ficaTax: ROUND(ficaTaxAnnual / periodsPerYear),
|
|
103
|
-
stateTax: ROUND(stateTaxAnnual / periodsPerYear),
|
|
104
|
-
netPay: ROUND(netPayAnnual / periodsPerYear),
|
|
105
|
-
payPeriodsPerYear: periodsPerYear,
|
|
106
|
-
federalTaxAnnual: ROUND(federalTaxAnnual),
|
|
107
|
-
ficaTaxAnnual: ROUND(ficaTaxAnnual),
|
|
108
|
-
stateTaxAnnual: ROUND(stateTaxAnnual),
|
|
109
|
-
netPayAnnual: ROUND(netPayAnnual),
|
|
110
|
-
noStateIncomeTax,
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
//# sourceMappingURL=paycheck.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"paycheck.js","sourceRoot":"","sources":["../../src/engines/paycheck.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,mCAAmC,EACnC,UAAU,EACV,YAAY,EACZ,oBAAoB,EACpB,aAAa,GAId,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC;AA8CtC,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;AAEvD;;GAEG;AACH,SAAS,UAAU,CAAC,aAAqB,EAAE,QAAsB;IAC/D,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,aAAa,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IACrD,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9C,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,aAAa,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;YAC1B,MAAM,gBAAgB,GAAG,aAAa,GAAG,CAAC,CAAC,GAAG,CAAC;YAC/C,OAAO,CAAC,CAAC,OAAO,GAAG,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC;QAC/C,CAAC;IACH,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,MAAM,CAAC,KAA0B;IAC/C,MAAM,E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