pigeongov 0.2.2 → 0.3.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/dist/src/advisory/cliff/calculator.d.ts +17 -0
- package/dist/src/advisory/cliff/calculator.js +117 -0
- package/dist/src/advisory/cliff/calculator.js.map +1 -0
- package/dist/src/advisory/cliff/programs.d.ts +24 -0
- package/dist/src/advisory/cliff/programs.js +108 -0
- package/dist/src/advisory/cliff/programs.js.map +1 -0
- package/dist/src/advisory/cost/estimator.d.ts +12 -0
- package/dist/src/advisory/cost/estimator.js +160 -0
- package/dist/src/advisory/cost/estimator.js.map +1 -0
- package/dist/src/advisory/dependencies/data.d.ts +11 -0
- package/dist/src/advisory/dependencies/data.js +350 -0
- package/dist/src/advisory/dependencies/data.js.map +1 -0
- package/dist/src/advisory/dependencies/graph.d.ts +20 -0
- package/dist/src/advisory/dependencies/graph.js +83 -0
- package/dist/src/advisory/dependencies/graph.js.map +1 -0
- package/dist/src/advisory/tracker/types.d.ts +18 -0
- package/dist/src/advisory/tracker/types.js +79 -0
- package/dist/src/advisory/tracker/types.js.map +1 -0
- package/dist/src/advisory/tracker/uscis.d.ts +20 -0
- package/dist/src/advisory/tracker/uscis.js +98 -0
- package/dist/src/advisory/tracker/uscis.js.map +1 -0
- package/dist/src/cli/commands/cliff.d.ts +2 -0
- package/dist/src/cli/commands/cliff.js +76 -0
- package/dist/src/cli/commands/cliff.js.map +1 -0
- package/dist/src/cli/commands/cost.d.ts +2 -0
- package/dist/src/cli/commands/cost.js +86 -0
- package/dist/src/cli/commands/cost.js.map +1 -0
- package/dist/src/cli/commands/deadlines.js +66 -8
- package/dist/src/cli/commands/deadlines.js.map +1 -1
- package/dist/src/cli/commands/dependencies.d.ts +2 -0
- package/dist/src/cli/commands/dependencies.js +62 -0
- package/dist/src/cli/commands/dependencies.js.map +1 -0
- package/dist/src/cli/commands/doctor.js +59 -9
- package/dist/src/cli/commands/doctor.js.map +1 -1
- package/dist/src/cli/commands/fees.js +33 -10
- package/dist/src/cli/commands/fees.js.map +1 -1
- package/dist/src/cli/commands/fill.js +28 -11
- package/dist/src/cli/commands/fill.js.map +1 -1
- package/dist/src/cli/commands/glossary.js +30 -17
- package/dist/src/cli/commands/glossary.js.map +1 -1
- package/dist/src/cli/commands/life-event.js +56 -6
- package/dist/src/cli/commands/life-event.js.map +1 -1
- package/dist/src/cli/commands/list.js +33 -2
- package/dist/src/cli/commands/list.js.map +1 -1
- package/dist/src/cli/commands/track.d.ts +2 -0
- package/dist/src/cli/commands/track.js +85 -0
- package/dist/src/cli/commands/track.js.map +1 -0
- package/dist/src/cli/commands/workflows.js +33 -2
- package/dist/src/cli/commands/workflows.js.map +1 -1
- package/dist/src/cli/display/review.js +18 -1
- package/dist/src/cli/display/review.js.map +1 -1
- package/dist/src/cli/display/summary.js +45 -11
- package/dist/src/cli/display/summary.js.map +1 -1
- package/dist/src/cli/display/validation.js +33 -10
- package/dist/src/cli/display/validation.js.map +1 -1
- package/dist/src/cli/index.js +9 -1
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/cli/tui.js +10 -2
- package/dist/src/cli/tui.js.map +1 -1
- package/dist/src/mcp/tools/cliff.d.ts +23 -0
- package/dist/src/mcp/tools/cliff.js +29 -0
- package/dist/src/mcp/tools/cliff.js.map +1 -0
- package/dist/src/mcp/tools/cost-estimate.d.ts +7 -0
- package/dist/src/mcp/tools/cost-estimate.js +35 -0
- package/dist/src/mcp/tools/cost-estimate.js.map +1 -0
- package/dist/src/mcp/tools/dependencies.d.ts +7 -0
- package/dist/src/mcp/tools/dependencies.js +18 -0
- package/dist/src/mcp/tools/dependencies.js.map +1 -0
- package/dist/src/mcp/tools/track-case.d.ts +45 -0
- package/dist/src/mcp/tools/track-case.js +32 -0
- package/dist/src/mcp/tools/track-case.js.map +1 -0
- package/dist/src/schemas/2025/shared.js +7 -7
- package/dist/src/schemas/2025/shared.js.map +1 -1
- package/dist/src/types.d.ts +85 -0
- package/dist/src/workflows/domains/benefits.d.ts +4 -4
- package/dist/src/workflows/domains/business.d.ts +7 -7
- package/dist/src/workflows/domains/healthcare.d.ts +9 -9
- package/dist/src/workflows/domains/immigration.d.ts +8 -8
- package/dist/src/workflows/domains/legal.d.ts +3 -3
- package/dist/src/workflows/domains/permits.d.ts +7 -7
- package/dist/src/workflows/domains/tax.d.ts +12 -12
- package/dist/src/workflows/domains/unemployment.d.ts +7 -7
- package/dist/src/workflows/registry.d.ts +57 -57
- package/dist/src/workflows/registry.js +56 -2
- package/dist/src/workflows/registry.js.map +1 -1
- package/dist/src/workflows/schemas/benefits.d.ts +4 -4
- package/dist/src/workflows/schemas/common.d.ts +13 -13
- package/dist/src/workflows/schemas/common.js +9 -9
- package/dist/src/workflows/schemas/common.js.map +1 -1
- package/dist/src/workflows/schemas/healthcare.d.ts +9 -9
- package/dist/src/workflows/schemas/immigration.d.ts +8 -8
- package/dist/src/workflows/schemas/legal.d.ts +3 -3
- package/dist/src/workflows/schemas/planning.d.ts +7 -7
- package/dist/src/workflows/schemas/tax.d.ts +12 -12
- package/dist/src/workflows/schemas/unemployment.d.ts +7 -7
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Benefits cliff calculator.
|
|
3
|
+
*
|
|
4
|
+
* Given a household's income, size, and state, identifies every federal
|
|
5
|
+
* benefit program they currently qualify for, the exact income point
|
|
6
|
+
* where each one drops off, and the "safe raise threshold" — the
|
|
7
|
+
* income level where additional earnings more than offset the lost
|
|
8
|
+
* benefits. Three million US households face these perverse
|
|
9
|
+
* incentives; this calculator makes them visible.
|
|
10
|
+
*/
|
|
11
|
+
import type { CliffAnalysis } from "../../types.js";
|
|
12
|
+
export interface CliffInput {
|
|
13
|
+
annualIncome: number;
|
|
14
|
+
householdSize: number;
|
|
15
|
+
state?: string | undefined;
|
|
16
|
+
}
|
|
17
|
+
export declare function calculateCliff(input: CliffInput): CliffAnalysis;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Benefits cliff calculator.
|
|
3
|
+
*
|
|
4
|
+
* Given a household's income, size, and state, identifies every federal
|
|
5
|
+
* benefit program they currently qualify for, the exact income point
|
|
6
|
+
* where each one drops off, and the "safe raise threshold" — the
|
|
7
|
+
* income level where additional earnings more than offset the lost
|
|
8
|
+
* benefits. Three million US households face these perverse
|
|
9
|
+
* incentives; this calculator makes them visible.
|
|
10
|
+
*/
|
|
11
|
+
import { PROGRAMS, fplPercent, getFpl } from "./programs.js";
|
|
12
|
+
export function calculateCliff(input) {
|
|
13
|
+
const { annualIncome, householdSize, state = "CA" } = input;
|
|
14
|
+
// 1. Current benefits at this income
|
|
15
|
+
const currentBenefits = [];
|
|
16
|
+
for (const program of PROGRAMS) {
|
|
17
|
+
if (program.isEligible(annualIncome, householdSize)) {
|
|
18
|
+
const monthly = program.monthlyBenefit(annualIncome, householdSize);
|
|
19
|
+
if (monthly > 0) {
|
|
20
|
+
currentBenefits.push({
|
|
21
|
+
program: program.name,
|
|
22
|
+
monthlyValue: monthly,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
// 2. Find cliff points — each income where a program drops off.
|
|
28
|
+
// The loss figure is the benefit they receive *right now*, since
|
|
29
|
+
// that's the value they'd eventually forfeit by earning past the
|
|
30
|
+
// cutoff (even if the benefit slides down along the way).
|
|
31
|
+
const cliffPoints = [];
|
|
32
|
+
for (const program of PROGRAMS) {
|
|
33
|
+
const cutoff = program.cutoffIncome(householdSize);
|
|
34
|
+
if (cutoff > annualIncome && program.isEligible(annualIncome, householdSize)) {
|
|
35
|
+
const currentBenefit = program.monthlyBenefit(annualIncome, householdSize);
|
|
36
|
+
if (currentBenefit > 0) {
|
|
37
|
+
cliffPoints.push({
|
|
38
|
+
income: cutoff,
|
|
39
|
+
programLost: program.name,
|
|
40
|
+
monthlyLoss: currentBenefit,
|
|
41
|
+
annualLoss: currentBenefit * 12,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// Sort cliff points ascending by income
|
|
47
|
+
cliffPoints.sort((a, b) => a.income - b.income);
|
|
48
|
+
// 3. Calculate total current package (earnings + benefits)
|
|
49
|
+
const monthlyBenefitTotal = currentBenefits.reduce((sum, b) => sum + b.monthlyValue, 0);
|
|
50
|
+
const currentTotalAnnual = annualIncome + monthlyBenefitTotal * 12;
|
|
51
|
+
// 4. Find safe raise threshold — the income where
|
|
52
|
+
// (new income + remaining benefits) >= current total package.
|
|
53
|
+
// Walk income up in $500 increments for precision without being
|
|
54
|
+
// computationally extravagant.
|
|
55
|
+
let safeRaiseThreshold = annualIncome;
|
|
56
|
+
if (cliffPoints.length > 0) {
|
|
57
|
+
const ceiling = Math.max(...cliffPoints.map((c) => c.income), annualIncome);
|
|
58
|
+
// Scan from current income to well past the last cliff
|
|
59
|
+
for (let candidate = annualIncome + 500; candidate <= ceiling + 30_000; candidate += 500) {
|
|
60
|
+
let remainingMonthly = 0;
|
|
61
|
+
for (const program of PROGRAMS) {
|
|
62
|
+
if (program.isEligible(candidate, householdSize)) {
|
|
63
|
+
remainingMonthly += program.monthlyBenefit(candidate, householdSize);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const candidateTotal = candidate + remainingMonthly * 12;
|
|
67
|
+
if (candidateTotal >= currentTotalAnnual) {
|
|
68
|
+
safeRaiseThreshold = candidate;
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// If we never found a break-even, the furthest cliff + buffer
|
|
73
|
+
if (safeRaiseThreshold === annualIncome && cliffPoints.length > 0) {
|
|
74
|
+
safeRaiseThreshold = ceiling + 5_000;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// 5. Generate recommendation
|
|
78
|
+
const recommendation = buildRecommendation(annualIncome, householdSize, state, currentBenefits, cliffPoints, safeRaiseThreshold);
|
|
79
|
+
return {
|
|
80
|
+
currentIncome: annualIncome,
|
|
81
|
+
householdSize,
|
|
82
|
+
state,
|
|
83
|
+
currentBenefits,
|
|
84
|
+
cliffPoints,
|
|
85
|
+
safeRaiseThreshold,
|
|
86
|
+
recommendation,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function buildRecommendation(income, householdSize, state, benefits, cliffs, safeThreshold) {
|
|
90
|
+
const fplPct = fplPercent(income, householdSize);
|
|
91
|
+
const fpl = getFpl(householdSize);
|
|
92
|
+
if (benefits.length === 0) {
|
|
93
|
+
return (`At $${income.toLocaleString()}/year (${Math.round(fplPct)}% FPL for a household of ${householdSize}), ` +
|
|
94
|
+
`this household is above the eligibility thresholds for the major federal benefit programs. ` +
|
|
95
|
+
`No benefits cliffs apply.`);
|
|
96
|
+
}
|
|
97
|
+
const totalMonthly = benefits.reduce((s, b) => s + b.monthlyValue, 0);
|
|
98
|
+
const totalAnnual = totalMonthly * 12;
|
|
99
|
+
const programNames = benefits.map((b) => b.program).join(", ");
|
|
100
|
+
let text = `At $${income.toLocaleString()}/year (${Math.round(fplPct)}% FPL for a household of ${householdSize} in ${state}), ` +
|
|
101
|
+
`this household currently receives an estimated $${totalMonthly.toLocaleString()}/month ` +
|
|
102
|
+
`($${totalAnnual.toLocaleString()}/year) in benefits from: ${programNames}. `;
|
|
103
|
+
if (cliffs.length > 0) {
|
|
104
|
+
const nearestCliff = cliffs[0];
|
|
105
|
+
text +=
|
|
106
|
+
`The nearest cliff is at $${nearestCliff.income.toLocaleString()}/year, ` +
|
|
107
|
+
`where ${nearestCliff.programLost} drops off (losing $${nearestCliff.annualLoss.toLocaleString()}/year). `;
|
|
108
|
+
}
|
|
109
|
+
if (safeThreshold > income) {
|
|
110
|
+
const raiseNeeded = safeThreshold - income;
|
|
111
|
+
text +=
|
|
112
|
+
`To safely increase income without a net loss, aim for at least ` +
|
|
113
|
+
`$${safeThreshold.toLocaleString()}/year — a raise of $${raiseNeeded.toLocaleString()}/year.`;
|
|
114
|
+
}
|
|
115
|
+
return text;
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=calculator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calculator.js","sourceRoot":"","sources":["../../../../src/advisory/cliff/calculator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAQ7D,MAAM,UAAU,cAAc,CAAC,KAAiB;IAC9C,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAE5D,qCAAqC;IACrC,MAAM,eAAe,GAAqC,EAAE,CAAC;IAC7D,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE,aAAa,CAAC,EAAE,CAAC;YACpD,MAAM,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;YACpE,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;gBAChB,eAAe,CAAC,IAAI,CAAC;oBACnB,OAAO,EAAE,OAAO,CAAC,IAAI;oBACrB,YAAY,EAAE,OAAO;iBACtB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,gEAAgE;IAChE,oEAAoE;IACpE,oEAAoE;IACpE,6DAA6D;IAC7D,MAAM,WAAW,GAAiC,EAAE,CAAC;IACrD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;QACnD,IAAI,MAAM,GAAG,YAAY,IAAI,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE,aAAa,CAAC,EAAE,CAAC;YAC7E,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;YAC3E,IAA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AAE,CAAC,CAAC,CAAC;IACtE,MAAM,WAAW,GAAG,YAAY,GAAG,EAAE,CAAC;IACtC,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE/D,IAAI,IAAI,GACN,OAAO,MAAM,CAAC,cAAc,EAAE,UAAU,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,4BAA4B,aAAa,OAAO,KAAK,KAAK;QACpH,mDAAmD,YAAY,CAAC,cAAc,EAAE,SAAS;QACzF,KAAK,WAAW,CAAC,cAAc,EAAE,4BAA4B,YAAY,IAAI,CAAC;IAEhF,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,MAAM,YAAY,GAAG,MAAM,CAAC,CAAC,CAAE,CAAC;QAChC,IAAI;YACF,4BAA4B,YAAY,CAAC,MAAM,CAAC,cAAc,EAAE,SAAS;gBACzE,SAAS,YAAY,CAAC,WAAW,uBAAuB,YAAY,CAAC,UAAU,CAAC,cAAc,EAAE,UAAU,CAAC;IAC/G,CAAC;IAED,IAAI,aAAa,GAAG,MAAM,EAAE,CAAC;QAC3B,MAAM,WAAW,GAAG,aAAa,GAAG,MAAM,CAAC;QAC3C,IAAI;YACF,iEAAiE;gBACjE,IAAI,aAAa,CAAC,cAAc,EAAE,uBAAuB,WAAW,CAAC,cAAc,EAAE,QAAQ,CAAC;IAClG,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Federal poverty level constants and benefit program definitions.
|
|
3
|
+
*
|
|
4
|
+
* FPL figures are 2025 HHS guidelines for the 48 contiguous states + DC.
|
|
5
|
+
* Alaska and Hawaii use higher thresholds in practice, but we use the
|
|
6
|
+
* continental baseline here — conservative is honest.
|
|
7
|
+
*/
|
|
8
|
+
export declare const FPL_BASE = 15650;
|
|
9
|
+
export declare const FPL_PER_ADDITIONAL = 5580;
|
|
10
|
+
export declare function getFpl(householdSize: number): number;
|
|
11
|
+
export declare function fplPercent(income: number, householdSize: number): number;
|
|
12
|
+
export interface ProgramDefinition {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
/** FPL percentage cutoff — income above this kills eligibility */
|
|
16
|
+
cutoffFplPercent: number;
|
|
17
|
+
/** Whether this household size + income qualifies */
|
|
18
|
+
isEligible: (income: number, householdSize: number) => boolean;
|
|
19
|
+
/** Monthly benefit value at given income */
|
|
20
|
+
monthlyBenefit: (income: number, householdSize: number) => number;
|
|
21
|
+
/** Income at which eligibility ends */
|
|
22
|
+
cutoffIncome: (householdSize: number) => number;
|
|
23
|
+
}
|
|
24
|
+
export declare const PROGRAMS: ProgramDefinition[];
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Federal poverty level constants and benefit program definitions.
|
|
3
|
+
*
|
|
4
|
+
* FPL figures are 2025 HHS guidelines for the 48 contiguous states + DC.
|
|
5
|
+
* Alaska and Hawaii use higher thresholds in practice, but we use the
|
|
6
|
+
* continental baseline here — conservative is honest.
|
|
7
|
+
*/
|
|
8
|
+
// --- FPL 2025 ---
|
|
9
|
+
export const FPL_BASE = 15_650;
|
|
10
|
+
export const FPL_PER_ADDITIONAL = 5_580;
|
|
11
|
+
export function getFpl(householdSize) {
|
|
12
|
+
if (householdSize < 1)
|
|
13
|
+
return FPL_BASE;
|
|
14
|
+
return FPL_BASE + FPL_PER_ADDITIONAL * (householdSize - 1);
|
|
15
|
+
}
|
|
16
|
+
export function fplPercent(income, householdSize) {
|
|
17
|
+
return (income / getFpl(householdSize)) * 100;
|
|
18
|
+
}
|
|
19
|
+
// SNAP max monthly allotments by household size (FY2025)
|
|
20
|
+
const SNAP_MAX_ALLOTMENTS = {
|
|
21
|
+
1: 292,
|
|
22
|
+
2: 536,
|
|
23
|
+
3: 768,
|
|
24
|
+
4: 975,
|
|
25
|
+
5: 1_158,
|
|
26
|
+
6: 1_390,
|
|
27
|
+
7: 1_536,
|
|
28
|
+
8: 1_756,
|
|
29
|
+
};
|
|
30
|
+
function getSnapMaxAllotment(householdSize) {
|
|
31
|
+
if (householdSize <= 0)
|
|
32
|
+
return 0;
|
|
33
|
+
if (householdSize <= 8)
|
|
34
|
+
return SNAP_MAX_ALLOTMENTS[householdSize] ?? 0;
|
|
35
|
+
// Each additional person above 8 adds ~$220
|
|
36
|
+
return (SNAP_MAX_ALLOTMENTS[8] ?? 1_756) + (householdSize - 8) * 220;
|
|
37
|
+
}
|
|
38
|
+
export const PROGRAMS = [
|
|
39
|
+
{
|
|
40
|
+
id: "snap",
|
|
41
|
+
name: "SNAP (Food Stamps)",
|
|
42
|
+
cutoffFplPercent: 130,
|
|
43
|
+
isEligible: (income, hs) => income <= getFpl(hs) * 1.3,
|
|
44
|
+
monthlyBenefit: (income, hs) => {
|
|
45
|
+
if (income > getFpl(hs) * 1.3)
|
|
46
|
+
return 0;
|
|
47
|
+
const max = getSnapMaxAllotment(hs);
|
|
48
|
+
// Benefit reduces by 30% of net income above a deduction floor
|
|
49
|
+
const standardDeduction = hs <= 3 ? 198 : hs <= 5 ? 208 : 239;
|
|
50
|
+
const monthlyIncome = income / 12;
|
|
51
|
+
const netIncome = Math.max(0, monthlyIncome - standardDeduction);
|
|
52
|
+
const reduction = netIncome * 0.3;
|
|
53
|
+
return Math.max(0, Math.round(max - reduction));
|
|
54
|
+
},
|
|
55
|
+
cutoffIncome: (hs) => Math.floor(getFpl(hs) * 1.3),
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: "medicaid",
|
|
59
|
+
name: "Medicaid",
|
|
60
|
+
cutoffFplPercent: 138,
|
|
61
|
+
isEligible: (income, hs) => income <= getFpl(hs) * 1.38,
|
|
62
|
+
monthlyBenefit: (_income, _hs) => 600,
|
|
63
|
+
cutoffIncome: (hs) => Math.floor(getFpl(hs) * 1.38),
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: "wic",
|
|
67
|
+
name: "WIC",
|
|
68
|
+
cutoffFplPercent: 185,
|
|
69
|
+
isEligible: (income, hs) => income <= getFpl(hs) * 1.85,
|
|
70
|
+
monthlyBenefit: (_income, _hs) => 75,
|
|
71
|
+
cutoffIncome: (hs) => Math.floor(getFpl(hs) * 1.85),
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: "liheap",
|
|
75
|
+
name: "LIHEAP (Energy Assistance)",
|
|
76
|
+
cutoffFplPercent: 150,
|
|
77
|
+
isEligible: (income, hs) => income <= getFpl(hs) * 1.5,
|
|
78
|
+
monthlyBenefit: (_income, _hs) => 50,
|
|
79
|
+
cutoffIncome: (hs) => Math.floor(getFpl(hs) * 1.5),
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: "aca_subsidy",
|
|
83
|
+
name: "ACA Premium Subsidy",
|
|
84
|
+
cutoffFplPercent: 400,
|
|
85
|
+
isEligible: (income, hs) => {
|
|
86
|
+
const pct = fplPercent(income, hs);
|
|
87
|
+
return pct >= 100 && pct <= 400;
|
|
88
|
+
},
|
|
89
|
+
monthlyBenefit: (income, hs) => {
|
|
90
|
+
const pct = fplPercent(income, hs);
|
|
91
|
+
if (pct < 100 || pct > 400)
|
|
92
|
+
return 0;
|
|
93
|
+
// Linear slide: $500/mo at 150% FPL -> $50/mo at 400% FPL
|
|
94
|
+
const t = Math.min(1, Math.max(0, (pct - 150) / (400 - 150)));
|
|
95
|
+
return Math.round(500 - t * 450);
|
|
96
|
+
},
|
|
97
|
+
cutoffIncome: (hs) => Math.floor(getFpl(hs) * 4.0),
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: "chip",
|
|
101
|
+
name: "CHIP (Children's Health Insurance)",
|
|
102
|
+
cutoffFplPercent: 200,
|
|
103
|
+
isEligible: (income, hs) => income <= getFpl(hs) * 2.0,
|
|
104
|
+
monthlyBenefit: (_income, _hs) => 200,
|
|
105
|
+
cutoffIncome: (hs) => Math.floor(getFpl(hs) * 2.0),
|
|
106
|
+
},
|
|
107
|
+
];
|
|
108
|
+
//# sourceMappingURL=programs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"programs.js","sourceRoot":"","sources":["../../../../src/advisory/cliff/programs.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,mBAAmB;AAEnB,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC;AAC/B,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAExC,MAAM,UAAU,MAAM,CAAC,aAAqB;IAC1C,IAAI,aAAa,GAAG,CAAC;QAAE,OAAO,QAAQ,CAAC;IACvC,OAAO,QAAQ,GAAG,kBAAkB,GAAG,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,MAAc,EAAE,aAAqB;IAC9D,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,GAAG,CAAC;AAChD,CAAC;AAiBD,yDAAyD;AACzD,MAAM,mBAAmB,GAA2B;IAClD,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,KAAK;CACT,CAAC;AAEF,SAAS,mBAAmB,CAAC,aAAqB;IAChD,IAAI,aAAa,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IACjC,IAAI,aAAa,IAAI,CAAC;QAAE,OAAO,mBAAmB,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACvE,4CAA4C;IAC5C,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,aAAa,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;AACvE,C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AAE,EAAE,EAAE;YAC7B,MAAM,GAAG,GAAG,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YACnC,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG;gBAAE,OAAO,CAAC,CAAC;YACrC,0DAA0D;YAC1D,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;YAC9D,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;QACnC,CAAC;QACD,YAAY,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;KACnD;IACD;QACE,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,oCAAoC;QAC1C,gBAAgB,EAAE,GAAG;QACrB,UAAU,EAAE,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,IAAI,MAAM,CAAC,EAAE,CAAC,GAAG,GAAG;QACtD,cAAc,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG;QACrC,YAAY,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;KACnD;CACF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CostEstimate } from "../../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Estimate the cost of a government workflow across three tiers:
|
|
4
|
+
* DIY, with PigeonGov (free tooling), and with an attorney.
|
|
5
|
+
*
|
|
6
|
+
* Returns `null` for unknown workflows.
|
|
7
|
+
*/
|
|
8
|
+
export declare function estimateCost(workflowId: string): CostEstimate | null;
|
|
9
|
+
/**
|
|
10
|
+
* List all workflow IDs that have cost data available.
|
|
11
|
+
*/
|
|
12
|
+
export declare function listAvailableCosts(): string[];
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
const COST_DATABASE = {
|
|
2
|
+
"tax/1040": {
|
|
3
|
+
fees: [
|
|
4
|
+
{ item: "Federal e-file", min: 0, max: 0, type: "filing" },
|
|
5
|
+
],
|
|
6
|
+
attorney: {
|
|
7
|
+
min: 200,
|
|
8
|
+
max: 1200,
|
|
9
|
+
description: "CPA or enrolled agent preparation fee — varies by return complexity",
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
"immigration/family-visa-intake": {
|
|
13
|
+
fees: [
|
|
14
|
+
{ item: "I-130 filing fee", min: 675, max: 675, type: "filing" },
|
|
15
|
+
{ item: "I-485 filing fee", min: 1440, max: 1440, type: "filing" },
|
|
16
|
+
{ item: "Biometrics fee", min: 85, max: 85, type: "biometric" },
|
|
17
|
+
{ item: "Medical examination (I-693)", min: 200, max: 500, type: "medical" },
|
|
18
|
+
],
|
|
19
|
+
attorney: {
|
|
20
|
+
min: 2000,
|
|
21
|
+
max: 5000,
|
|
22
|
+
description: "Immigration attorney for family-based petition through adjustment of status",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
"immigration/naturalization": {
|
|
26
|
+
fees: [
|
|
27
|
+
{ item: "N-400 filing fee", min: 760, max: 760, type: "filing" },
|
|
28
|
+
{ item: "Passport-style photos", min: 10, max: 30, type: "photo" },
|
|
29
|
+
],
|
|
30
|
+
attorney: {
|
|
31
|
+
min: 1500,
|
|
32
|
+
max: 7500,
|
|
33
|
+
description: "Immigration attorney for naturalization — higher end for complex cases",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
"legal/small-claims": {
|
|
37
|
+
fees: [
|
|
38
|
+
{ item: "Court filing fee", min: 75, max: 75, type: "filing" },
|
|
39
|
+
{ item: "Service of process", min: 20, max: 75, type: "service" },
|
|
40
|
+
],
|
|
41
|
+
attorney: {
|
|
42
|
+
min: 500,
|
|
43
|
+
max: 2000,
|
|
44
|
+
description: "Attorney representation or consultation for small claims matter",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
"legal/expungement": {
|
|
48
|
+
fees: [
|
|
49
|
+
{ item: "Petition filing fee", min: 250, max: 250, type: "filing" },
|
|
50
|
+
{ item: "Background check", min: 25, max: 50, type: "background" },
|
|
51
|
+
{ item: "Fingerprinting", min: 20, max: 50, type: "biometric" },
|
|
52
|
+
],
|
|
53
|
+
attorney: {
|
|
54
|
+
min: 900,
|
|
55
|
+
max: 3000,
|
|
56
|
+
description: "Attorney for criminal record expungement petition and hearing",
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
"estate/basic-will": {
|
|
60
|
+
fees: [
|
|
61
|
+
{ item: "Notarization", min: 10, max: 25, type: "notarization" },
|
|
62
|
+
],
|
|
63
|
+
attorney: {
|
|
64
|
+
min: 300,
|
|
65
|
+
max: 1500,
|
|
66
|
+
description: "Estate attorney for will drafting and execution",
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
"identity/passport": {
|
|
70
|
+
fees: [
|
|
71
|
+
{ item: "DS-11 application fee", min: 165, max: 165, type: "filing" },
|
|
72
|
+
{ item: "Execution / acceptance fee", min: 35, max: 35, type: "service" },
|
|
73
|
+
{ item: "Passport photos", min: 10, max: 20, type: "photo" },
|
|
74
|
+
{ item: "Expedited processing", min: 0, max: 60, type: "expedite" },
|
|
75
|
+
],
|
|
76
|
+
attorney: {
|
|
77
|
+
min: 100,
|
|
78
|
+
max: 400,
|
|
79
|
+
description: "Passport expediting service or attorney assistance — rarely needed",
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
"identity/name-change": {
|
|
83
|
+
fees: [
|
|
84
|
+
{ item: "Court petition filing fee", min: 200, max: 200, type: "filing" },
|
|
85
|
+
{ item: "Legal publication requirement", min: 0, max: 150, type: "publication" },
|
|
86
|
+
{ item: "Certified copies of order", min: 10, max: 50, type: "optional" },
|
|
87
|
+
],
|
|
88
|
+
attorney: {
|
|
89
|
+
min: 300,
|
|
90
|
+
max: 1000,
|
|
91
|
+
description: "Attorney for name change petition, publication, and court appearance",
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
// ---------------------------------------------------------------------------
|
|
96
|
+
// Helpers
|
|
97
|
+
// ---------------------------------------------------------------------------
|
|
98
|
+
function sumBreakdown(fees, pick) {
|
|
99
|
+
return fees.reduce((acc, f) => acc + f[pick], 0);
|
|
100
|
+
}
|
|
101
|
+
function toBreakdown(fees, pick) {
|
|
102
|
+
return fees.map((f) => ({ item: f.item, amount: f[pick], type: f.type }));
|
|
103
|
+
}
|
|
104
|
+
// ---------------------------------------------------------------------------
|
|
105
|
+
// Public API
|
|
106
|
+
// ---------------------------------------------------------------------------
|
|
107
|
+
/**
|
|
108
|
+
* Estimate the cost of a government workflow across three tiers:
|
|
109
|
+
* DIY, with PigeonGov (free tooling), and with an attorney.
|
|
110
|
+
*
|
|
111
|
+
* Returns `null` for unknown workflows.
|
|
112
|
+
*/
|
|
113
|
+
export function estimateCost(workflowId) {
|
|
114
|
+
const entry = COST_DATABASE[workflowId];
|
|
115
|
+
if (!entry)
|
|
116
|
+
return null;
|
|
117
|
+
const diyMin = sumBreakdown(entry.fees, "min");
|
|
118
|
+
const diyMax = sumBreakdown(entry.fees, "max");
|
|
119
|
+
// PigeonGov is free — same government fees, no tool surcharge
|
|
120
|
+
const withToolMin = diyMin;
|
|
121
|
+
const withToolMax = diyMax;
|
|
122
|
+
const attMin = diyMin + entry.attorney.min;
|
|
123
|
+
const attMax = diyMax + entry.attorney.max;
|
|
124
|
+
// Savings: compare midpoint of attorney range to midpoint of with-tool
|
|
125
|
+
const attMid = (attMin + attMax) / 2;
|
|
126
|
+
const toolMid = (withToolMin + withToolMax) / 2;
|
|
127
|
+
const vsAttorney = Math.round(attMid - toolMid);
|
|
128
|
+
return {
|
|
129
|
+
workflowId,
|
|
130
|
+
diyTotal: {
|
|
131
|
+
min: diyMin,
|
|
132
|
+
max: diyMax,
|
|
133
|
+
breakdown: toBreakdown(entry.fees, "min"),
|
|
134
|
+
},
|
|
135
|
+
withToolTotal: {
|
|
136
|
+
min: withToolMin,
|
|
137
|
+
max: withToolMax,
|
|
138
|
+
breakdown: toBreakdown(entry.fees, "min"),
|
|
139
|
+
},
|
|
140
|
+
withAttorneyTotal: {
|
|
141
|
+
min: attMin,
|
|
142
|
+
max: attMax,
|
|
143
|
+
breakdown: [
|
|
144
|
+
...toBreakdown(entry.fees, "min"),
|
|
145
|
+
{ item: "Attorney fee", amount: entry.attorney.min, type: "attorney" },
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
savings: {
|
|
149
|
+
vsAttorney,
|
|
150
|
+
description: entry.attorney.description,
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* List all workflow IDs that have cost data available.
|
|
156
|
+
*/
|
|
157
|
+
export function listAvailableCosts() {
|
|
158
|
+
return Object.keys(COST_DATABASE).sort();
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=estimator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimator.js","sourceRoot":"","sources":["../../../../src/advisory/cost/estimator.ts"],"names":[],"mappings":"AA6BA,MAAM,aAAa,GAAsC;IACvD,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,EAAE,IAAI,EAAE,gBAAgB,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC3D;QACD,QAAQ,EAAE;YACR,GAAG,EAAE,GAAG;YACR,GAAG,EAAE,IAAI;YACT,WAAW,EAAE,qEAAqE;SACnF;KACF;IAED,gCAAgC,EAAE;QAChC,IAAI,EAAE;YACJ,EAAE,IAAI,EAAE,kBAAkB,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EA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AE;YACP,UAAU;YACV,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,WAAW;SACxC;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,IAAI,EAAE,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { WorkflowDependency } from "../../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Cross-agency dependency graph for PigeonGov workflows.
|
|
4
|
+
*
|
|
5
|
+
* Each edge encodes a real-world regulatory or procedural relationship
|
|
6
|
+
* between two government workflows. The graph powers downstream cascade
|
|
7
|
+
* detection ("you just naturalized — here's everything else that changes")
|
|
8
|
+
* and upstream requirement surfacing ("voter registration expects one of
|
|
9
|
+
* these preconditions to be in place").
|
|
10
|
+
*/
|
|
11
|
+
export declare const WORKFLOW_DEPENDENCIES: WorkflowDependency[];
|