@markcolabs/mcp 0.1.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.
Files changed (74) hide show
  1. package/README.md +263 -0
  2. package/dist/disclaimers/ymyl.d.ts +16 -0
  3. package/dist/disclaimers/ymyl.d.ts.map +1 -0
  4. package/dist/disclaimers/ymyl.js +20 -0
  5. package/dist/disclaimers/ymyl.js.map +1 -0
  6. package/dist/engines/compoundInterest.d.ts +73 -0
  7. package/dist/engines/compoundInterest.d.ts.map +1 -0
  8. package/dist/engines/compoundInterest.js +72 -0
  9. package/dist/engines/compoundInterest.js.map +1 -0
  10. package/dist/engines/data/federalTax.d.ts +47 -0
  11. package/dist/engines/data/federalTax.d.ts.map +1 -0
  12. package/dist/engines/data/federalTax.js +111 -0
  13. package/dist/engines/data/federalTax.js.map +1 -0
  14. package/dist/engines/data/irs2026.d.ts +30 -0
  15. package/dist/engines/data/irs2026.d.ts.map +1 -0
  16. package/dist/engines/data/irs2026.js +30 -0
  17. package/dist/engines/data/irs2026.js.map +1 -0
  18. package/dist/engines/data/ssa.d.ts +39 -0
  19. package/dist/engines/data/ssa.d.ts.map +1 -0
  20. package/dist/engines/data/ssa.js +55 -0
  21. package/dist/engines/data/ssa.js.map +1 -0
  22. package/dist/engines/mortgage.d.ts +69 -0
  23. package/dist/engines/mortgage.d.ts.map +1 -0
  24. package/dist/engines/mortgage.js +59 -0
  25. package/dist/engines/mortgage.js.map +1 -0
  26. package/dist/engines/paycheck.d.ts +89 -0
  27. package/dist/engines/paycheck.d.ts.map +1 -0
  28. package/dist/engines/paycheck.js +109 -0
  29. package/dist/engines/paycheck.js.map +1 -0
  30. package/dist/engines/retirement401k.d.ts +105 -0
  31. package/dist/engines/retirement401k.d.ts.map +1 -0
  32. package/dist/engines/retirement401k.js +126 -0
  33. package/dist/engines/retirement401k.js.map +1 -0
  34. package/dist/engines/socialSecurity.d.ts +59 -0
  35. package/dist/engines/socialSecurity.d.ts.map +1 -0
  36. package/dist/engines/socialSecurity.js +135 -0
  37. package/dist/engines/socialSecurity.js.map +1 -0
  38. package/dist/envelope.d.ts +76 -0
  39. package/dist/envelope.d.ts.map +1 -0
  40. package/dist/envelope.js +34 -0
  41. package/dist/envelope.js.map +1 -0
  42. package/dist/index.d.ts +30 -0
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +197 -0
  45. package/dist/index.js.map +1 -0
  46. package/dist/shared/bounds.d.ts +83 -0
  47. package/dist/shared/bounds.d.ts.map +1 -0
  48. package/dist/shared/bounds.js +121 -0
  49. package/dist/shared/bounds.js.map +1 -0
  50. package/dist/tools/compoundInterest.d.ts +48 -0
  51. package/dist/tools/compoundInterest.d.ts.map +1 -0
  52. package/dist/tools/compoundInterest.js +107 -0
  53. package/dist/tools/compoundInterest.js.map +1 -0
  54. package/dist/tools/mortgage.d.ts +51 -0
  55. package/dist/tools/mortgage.d.ts.map +1 -0
  56. package/dist/tools/mortgage.js +112 -0
  57. package/dist/tools/mortgage.js.map +1 -0
  58. package/dist/tools/paycheck.d.ts +54 -0
  59. package/dist/tools/paycheck.d.ts.map +1 -0
  60. package/dist/tools/paycheck.js +122 -0
  61. package/dist/tools/paycheck.js.map +1 -0
  62. package/dist/tools/retirement401k.d.ts +85 -0
  63. package/dist/tools/retirement401k.d.ts.map +1 -0
  64. package/dist/tools/retirement401k.js +141 -0
  65. package/dist/tools/retirement401k.js.map +1 -0
  66. package/dist/tools/socialSecurity.d.ts +51 -0
  67. package/dist/tools/socialSecurity.d.ts.map +1 -0
  68. package/dist/tools/socialSecurity.js +117 -0
  69. package/dist/tools/socialSecurity.js.map +1 -0
  70. package/dist/util/zod-to-json-schema.d.ts +28 -0
  71. package/dist/util/zod-to-json-schema.d.ts.map +1 -0
  72. package/dist/util/zod-to-json-schema.js +98 -0
  73. package/dist/util/zod-to-json-schema.js.map +1 -0
  74. package/package.json +53 -0
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,30 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,39 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,55 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,69 @@
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. Bumps when math changes OR when the
23
+ * package's overall surface area changes meaningfully (S136 batch bump).
24
+ * - 0.1.0: initial v1 lift from mortgage-calculator.js (Sprint 135 Item 5).
25
+ * - 0.2.0: minor batch bump on S136 (no math change here, but package adds
26
+ * 3 new engines; bump keeps cross-engine ENGINE_VERSION values aligned for
27
+ * the v0.1.0 npm publish surface).
28
+ */
29
+ export declare const ENGINE_VERSION = "0.2.0";
30
+ /**
31
+ * Inputs to the mortgage monthly-payment engine.
32
+ *
33
+ * Per ADR-0039 § 2:
34
+ * - Monetary fields are bare USD numbers.
35
+ * - Percentage fields use whole-number-percent units (e.g., 6.5 for 6.5%).
36
+ *
37
+ * NOTE on convention vs. sprint prompt: the sprint prompt referenced
38
+ * decimal-rate inputs (0.065). ADR-0039 § 2 locks the `Percent` suffix +
39
+ * whole-number-percent convention. The contract wins; this engine accepts
40
+ * `annualRatePercent` (e.g., 6.5).
41
+ */
42
+ export interface MortgageMonthlyPaymentInput {
43
+ /** Principal loan amount in USD. */
44
+ principal: number;
45
+ /** Annual interest rate as whole-number percent (e.g., 6.5 for 6.5%). */
46
+ annualRatePercent: number;
47
+ /** Loan term in years. Must be a positive integer. */
48
+ termYears: number;
49
+ }
50
+ /**
51
+ * Result payload (what goes inside ToolResult.result).
52
+ */
53
+ export interface MortgageMonthlyPaymentResult {
54
+ /** Monthly principal & interest payment, in USD. */
55
+ monthlyPayment: number;
56
+ /** Total interest paid over the life of the loan, in USD. */
57
+ totalInterest: number;
58
+ /** Total paid (principal + interest) over the life of the loan, in USD. */
59
+ totalPaid: number;
60
+ }
61
+ /**
62
+ * Compute the monthly principal & interest payment.
63
+ *
64
+ * 1-to-1 port of site/src/pages/mortgage-calculator/mortgage-calculator.js
65
+ * function `calculateMonthlyPI`. Same math, same edge case handling
66
+ * (0% rate → straight-line amortization).
67
+ */
68
+ export declare function monthlyPayment(input: MortgageMonthlyPaymentInput): MortgageMonthlyPaymentResult;
69
+ //# sourceMappingURL=mortgage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mortgage.d.ts","sourceRoot":"","sources":["../../src/engines/mortgage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;;;GAOG;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"}
@@ -0,0 +1,59 @@
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. Bumps when math changes OR when the
23
+ * package's overall surface area changes meaningfully (S136 batch bump).
24
+ * - 0.1.0: initial v1 lift from mortgage-calculator.js (Sprint 135 Item 5).
25
+ * - 0.2.0: minor batch bump on S136 (no math change here, but package adds
26
+ * 3 new engines; bump keeps cross-engine ENGINE_VERSION values aligned for
27
+ * the v0.1.0 npm publish surface).
28
+ */
29
+ export const ENGINE_VERSION = "0.2.0";
30
+ /**
31
+ * Compute the monthly principal & interest payment.
32
+ *
33
+ * 1-to-1 port of site/src/pages/mortgage-calculator/mortgage-calculator.js
34
+ * function `calculateMonthlyPI`. Same math, same edge case handling
35
+ * (0% rate → straight-line amortization).
36
+ */
37
+ export function monthlyPayment(input) {
38
+ const { principal, annualRatePercent, termYears } = input;
39
+ const monthlyRate = annualRatePercent / 100 / 12;
40
+ const numPayments = termYears * 12;
41
+ let monthly;
42
+ if (annualRatePercent === 0) {
43
+ monthly = principal / numPayments;
44
+ }
45
+ else {
46
+ monthly =
47
+ principal *
48
+ ((monthlyRate * Math.pow(1 + monthlyRate, numPayments)) /
49
+ (Math.pow(1 + monthlyRate, numPayments) - 1));
50
+ }
51
+ const totalPaid = monthly * numPayments;
52
+ const totalInterest = totalPaid - principal;
53
+ return {
54
+ monthlyPayment: monthly,
55
+ totalInterest,
56
+ totalPaid,
57
+ };
58
+ }
59
+ //# sourceMappingURL=mortgage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mortgage.js","sourceRoot":"","sources":["../../src/engines/mortgage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;;;GAOG;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"}
@@ -0,0 +1,89 @@
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.
34
+ * - 0.2.0: initial port (S136). Co-incident with the package-wide S136 batch bump.
35
+ */
36
+ export declare const ENGINE_VERSION = "0.2.0";
37
+ /** Inputs to the paycheck net-pay engine. */
38
+ export interface PaycheckNetPayInput {
39
+ /** Gross annual salary, USD. */
40
+ grossAnnualSalary: number;
41
+ /** Pay frequency. */
42
+ payFrequency: PayFrequencyLabel;
43
+ /** Federal filing status (camelCase, matches paycheck engine). */
44
+ federalFilingStatus: FilingStatus;
45
+ /** Two-letter state code (e.g., "CA", "TX"). */
46
+ state: string;
47
+ /** Number of dependents claimed. */
48
+ dependents: number;
49
+ /** Total pre-tax deductions (401k, HSA, FSA, etc.) per year, USD. */
50
+ preTaxDeductionsAnnual: number;
51
+ /** Total post-tax deductions (Roth contributions, garnishments, etc.) per year, USD. */
52
+ postTaxDeductionsAnnual: number;
53
+ }
54
+ /** Result payload returned by the engine. */
55
+ export interface PaycheckNetPayResult {
56
+ /** Gross pay per paycheck, USD. */
57
+ grossPerPaycheck: number;
58
+ /** Federal income-tax withholding per paycheck, USD. */
59
+ federalTax: number;
60
+ /** Total FICA per paycheck (SS + Medicare + Additional Medicare), USD. */
61
+ ficaTax: number;
62
+ /** State-tax estimate per paycheck, USD. */
63
+ stateTax: number;
64
+ /** Net pay per paycheck, USD. */
65
+ netPay: number;
66
+ /** Number of pay periods per year. */
67
+ payPeriodsPerYear: number;
68
+ /** Annualized federal tax, USD. */
69
+ federalTaxAnnual: number;
70
+ /** Annualized FICA, USD. */
71
+ ficaTaxAnnual: number;
72
+ /** Annualized state tax estimate, USD. */
73
+ stateTaxAnnual: number;
74
+ /** Annualized net pay, USD. */
75
+ netPayAnnual: number;
76
+ /** Whether the state has no income tax. */
77
+ noStateIncomeTax: boolean;
78
+ }
79
+ /**
80
+ * Compute net pay (and the annualized + per-paycheck breakdown).
81
+ *
82
+ * Implementation note: dependents currently has no effect under the simplified
83
+ * 2026 federal Percentage Method (the site engine likewise doesn't apply
84
+ * dependent credits in the per-paycheck calc). The field is part of the
85
+ * contract for forward compatibility (Form W-4 line 3 dependents credit may be
86
+ * added in a later engine version).
87
+ */
88
+ export declare function netPay(input: PaycheckNetPayInput): PaycheckNetPayResult;
89
+ //# sourceMappingURL=paycheck.d.ts.map
@@ -0,0 +1 @@
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;;;GAGG;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"}
@@ -0,0 +1,109 @@
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.
34
+ * - 0.2.0: initial port (S136). Co-incident with the package-wide S136 batch bump.
35
+ */
36
+ export const ENGINE_VERSION = "0.2.0";
37
+ const ROUND = (v) => Math.round(v * 100) / 100;
38
+ /**
39
+ * Progressive bracket lookup — verbatim port of site `calculateBracketTax`.
40
+ */
41
+ function bracketTax(taxableIncome, brackets) {
42
+ if (!brackets.length || taxableIncome <= 0)
43
+ return 0;
44
+ for (let i = brackets.length - 1; i >= 0; i--) {
45
+ const b = brackets[i];
46
+ if (taxableIncome > b.min) {
47
+ const taxableInBracket = taxableIncome - b.min;
48
+ return b.baseTax + taxableInBracket * b.rate;
49
+ }
50
+ }
51
+ return 0;
52
+ }
53
+ /**
54
+ * Compute net pay (and the annualized + per-paycheck breakdown).
55
+ *
56
+ * Implementation note: dependents currently has no effect under the simplified
57
+ * 2026 federal Percentage Method (the site engine likewise doesn't apply
58
+ * dependent credits in the per-paycheck calc). The field is part of the
59
+ * contract for forward compatibility (Form W-4 line 3 dependents credit may be
60
+ * added in a later engine version).
61
+ */
62
+ export function netPay(input) {
63
+ const { grossAnnualSalary, payFrequency, federalFilingStatus, state, preTaxDeductionsAnnual, postTaxDeductionsAnnual, } = input;
64
+ const periodsPerYear = PAY_PERIODS_PER_YEAR[payFrequency];
65
+ // Annual basis after pre-tax deductions (income-tax-reducible).
66
+ const adjustedAnnual = Math.max(0, grossAnnualSalary - preTaxDeductionsAnnual);
67
+ // Federal: standard deduction → taxable income → bracket lookup.
68
+ const stdDeduction = STANDARD_DEDUCTIONS_2026[federalFilingStatus];
69
+ const federalTaxable = Math.max(0, adjustedAnnual - stdDeduction);
70
+ const federalTaxAnnual = bracketTax(federalTaxable, FEDERAL_TAX_BRACKETS_2026[federalFilingStatus]);
71
+ // FICA on gross (less pre-tax cafeteria plan deductions; we conservatively
72
+ // apply pre-tax deductions to FICA since the kickoff input doesn't split
73
+ // 401k vs cafeteria-plan deductions — matches the more lenient employee view).
74
+ const ficaWages = adjustedAnnual;
75
+ const ssWageBase = SS_WAGE_BASE[2026] ?? SS_WAGE_BASE[2025];
76
+ const ssTaxAnnual = Math.min(ficaWages, ssWageBase) * FICA_RATES.socialSecurityRate;
77
+ const medicareAnnual = ficaWages * FICA_RATES.medicareRate;
78
+ const addlMedThreshold = ADDITIONAL_MEDICARE_THRESHOLDS_2026[federalFilingStatus];
79
+ const addlMedAnnual = grossAnnualSalary > addlMedThreshold
80
+ ? (grossAnnualSalary - addlMedThreshold) * FICA_RATES.additionalMedicareRate
81
+ : 0;
82
+ const ficaTaxAnnual = ssTaxAnnual + medicareAnnual + addlMedAnnual;
83
+ // State tax: no-tax states explicit zero; everyone else gets a flat 5%
84
+ // estimate over taxable income (clearly disclaimed in the envelope).
85
+ const stateUpper = state.trim().toUpperCase();
86
+ const noStateIncomeTax = NO_TAX_STATES.includes(stateUpper);
87
+ const stateTaxAnnual = noStateIncomeTax ? 0 : federalTaxable * 0.05;
88
+ // Net annual + per-paycheck.
89
+ const netPayAnnual = grossAnnualSalary -
90
+ preTaxDeductionsAnnual -
91
+ federalTaxAnnual -
92
+ ficaTaxAnnual -
93
+ stateTaxAnnual -
94
+ postTaxDeductionsAnnual;
95
+ return {
96
+ grossPerPaycheck: ROUND(grossAnnualSalary / periodsPerYear),
97
+ federalTax: ROUND(federalTaxAnnual / periodsPerYear),
98
+ ficaTax: ROUND(ficaTaxAnnual / periodsPerYear),
99
+ stateTax: ROUND(stateTaxAnnual / periodsPerYear),
100
+ netPay: ROUND(netPayAnnual / periodsPerYear),
101
+ payPeriodsPerYear: periodsPerYear,
102
+ federalTaxAnnual: ROUND(federalTaxAnnual),
103
+ ficaTaxAnnual: ROUND(ficaTaxAnnual),
104
+ stateTaxAnnual: ROUND(stateTaxAnnual),
105
+ netPayAnnual: ROUND(netPayAnnual),
106
+ noStateIncomeTax,
107
+ };
108
+ }
109
+ //# sourceMappingURL=paycheck.js.map
@@ -0,0 +1 @@
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;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC;AA8CtC,MAAM,KAAK,GAAG,CAAC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AAK,CAAC,cAAc,GAAG,cAAc,CAAC;QAChD,MAAM,EAAE,KAAK,CAAC,YAAY,GAAG,cAAc,CAAC;QAC5C,iBAAiB,EAAE,cAAc;QACjC,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,CAAC;QACzC,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC;QACnC,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC;QACrC,YAAY,EAAE,KAAK,CAAC,YAAY,CAAC;QACjC,gBAAgB;KACjB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,105 @@
1
+ /**
2
+ * 401(k) projection engine — lifted from
3
+ * site/src/pages/401k-retirement-calculator/401k-retirement-calculator.js
4
+ * (functions `calculateEmployerMatch`, `calculateFutureValue`,
5
+ * `generateYearlyBreakdown`, `getIRSLimit`, `getCatchUpAmount`,
6
+ * `calculate401kResults`).
7
+ *
8
+ * Per ADR-0039 § 5 (Calc-Engine Lift Pattern):
9
+ * - Pure synchronous functions of inputs → results. No DOM, no fetch.
10
+ * - ENGINE_VERSION bumps when math changes.
11
+ * - Parity tests at packages/mcp/test/parity/retirement401k.test.ts gate this
12
+ * engine against the source site calculator JS.
13
+ *
14
+ * MCP-side enhancement on top of the lift: the kickoff-defined input
15
+ * `annualSalaryGrowthPercent` is honored in this engine. The site engine
16
+ * applies a *flat* annual contribution; here we step year-by-year so each
17
+ * year's employee contribution + employer match scales with the cumulative
18
+ * salary growth. When `annualSalaryGrowthPercent === 0` the math is identical
19
+ * to the site engine (parity test "happy path" covers this).
20
+ *
21
+ * Math reference (year-by-year, mirroring the site's Math.pow form when growth=0):
22
+ * contrib_year_i = annualSalary * (1 + g)^i * (employeePct/100)
23
+ * (capped per IRS limit)
24
+ * match_year_i = annualSalary * (1 + g)^i * (matchedPct/100) * (employerMatchPct/100)
25
+ * balance_year_i = balance_year_{i-1} * (1 + r) + contrib_year_i + match_year_i
26
+ * balance_year_0 = currentBalance
27
+ *
28
+ * IRS limits: per IRS Notice 2025-67 (2026) — see engines/data/irs2026.ts.
29
+ */
30
+ /**
31
+ * SemVer of the 401(k) projection engine.
32
+ * - 0.2.0: initial port (S136). Co-incident with the package-wide S136 batch bump.
33
+ */
34
+ export declare const ENGINE_VERSION = "0.2.0";
35
+ /** Inputs to the 401(k) projection engine. */
36
+ export interface Retirement401kProjectionInput {
37
+ /** Current 401(k) balance, USD. */
38
+ currentBalance: number;
39
+ /** Current annual gross salary, USD. */
40
+ annualSalary: number;
41
+ /** Employee contribution as percent of salary (0-100). */
42
+ contributionPercent: number;
43
+ /**
44
+ * Employer match percent (0-100). Example: 50 means employer contributes
45
+ * $0.50 for each $1 the employee contributes, up to the match cap.
46
+ */
47
+ employerMatchPercent: number;
48
+ /**
49
+ * Cap on how much of the employee's contribution percent the employer
50
+ * matches. Example: 6 means the employer matches up to 6% of salary.
51
+ */
52
+ employerMatchLimitPercent: number;
53
+ /** Annual salary growth percent (0-20). 0 mirrors the site engine's flat-salary path. */
54
+ annualSalaryGrowthPercent: number;
55
+ /** Annual investment return percent (0-20). */
56
+ annualReturnPercent: number;
57
+ /** Current age (used for catch-up eligibility). */
58
+ currentAge: number;
59
+ /** Target retirement age (must be > currentAge). */
60
+ retirementAge: number;
61
+ /**
62
+ * Whether to enable catch-up contributions when eligible. Default true:
63
+ * if the user's age is in a catch-up window, apply the catch-up cap.
64
+ * Mirrors the site `catchUpToggle` form field semantics.
65
+ */
66
+ catchUpEnabled?: boolean;
67
+ }
68
+ /** One row of the year-by-year projection table. */
69
+ export interface Retirement401kYearRow {
70
+ /** Years from start (1..yearsToRetirement). */
71
+ year: number;
72
+ /** Age at end of this year. */
73
+ age: number;
74
+ /** Employee contribution this year (after IRS cap), USD. */
75
+ employeeContribution: number;
76
+ /** Employer match this year, USD. */
77
+ employerMatch: number;
78
+ /** Investment growth credited this year, USD. */
79
+ growth: number;
80
+ /** Ending balance for this year, USD. */
81
+ endingBalance: number;
82
+ }
83
+ /** Result payload returned by the engine. */
84
+ export interface Retirement401kProjectionResult {
85
+ /** Final 401(k) balance at retirement age, USD. */
86
+ futureBalance: number;
87
+ /** Sum of all employee contributions over the projection, USD. */
88
+ totalContributions: number;
89
+ /** Sum of all employer match contributions over the projection, USD. */
90
+ employerContribTotal: number;
91
+ /** futureBalance − (currentBalance + totalContributions + employerContribTotal). */
92
+ growthEarned: number;
93
+ /** Year-by-year rows from year 1 to year yearsToRetirement. */
94
+ yearByYear: Retirement401kYearRow[];
95
+ }
96
+ /**
97
+ * Project a 401(k) balance year by year through retirement.
98
+ *
99
+ * Uses the same per-year accumulation pattern as the site's
100
+ * `generateYearlyBreakdown` / `calculateFutureValue` (compounded annual return,
101
+ * end-of-year contributions). Differs from the site only in honoring
102
+ * `annualSalaryGrowthPercent` per kickoff input list.
103
+ */
104
+ export declare function projection(input: Retirement401kProjectionInput): Retirement401kProjectionResult;
105
+ //# sourceMappingURL=retirement401k.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retirement401k.d.ts","sourceRoot":"","sources":["../../src/engines/retirement401k.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH;;;GAGG;AACH,eAAO,MAAM,cAAc,UAAU,CAAC;AAEtC,8CAA8C;AAC9C,MAAM,WAAW,6BAA6B;IAC5C,mCAAmC;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,wCAAwC;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,yBAAyB,EAAE,MAAM,CAAC;IAClC,yFAAyF;IACzF,yBAAyB,EAAE,MAAM,CAAC;IAClC,+CAA+C;IAC/C,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,aAAa,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,cAAc,CAA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