@paro.io/expert-shared-components 1.14.51 → 1.14.53

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 (32) hide show
  1. package/lib/components/DocumentCenter/MultiFileUploadSection.js +220 -121
  2. package/lib/components/TaxAxis/TaxAxisApi.d.ts +1 -0
  3. package/lib/components/TaxAxis/TaxAxisShell.js +55 -12
  4. package/lib/index.d.ts +1 -14
  5. package/lib/index.js +1 -27
  6. package/lib/tax-axis/components/clientReport/TaxAxisClientReport.d.ts +6 -2
  7. package/lib/tax-axis/components/clientReport/TaxAxisClientReport.js +5 -3
  8. package/lib/tax-axis/components/dashboard/TaxAxisDashboard.d.ts +2 -1
  9. package/lib/tax-axis/components/dashboard/TaxAxisDashboard.js +163 -34
  10. package/lib/tax-axis/components/documents/DocumentCard.d.ts +3 -1
  11. package/lib/tax-axis/components/documents/DocumentCard.js +17 -5
  12. package/lib/tax-axis/components/documents/DocumentReviewModal.d.ts +13 -0
  13. package/lib/tax-axis/components/documents/DocumentReviewModal.js +248 -0
  14. package/lib/tax-axis/components/documents/DocumentTier.d.ts +3 -1
  15. package/lib/tax-axis/components/documents/DocumentTier.js +2 -2
  16. package/lib/tax-axis/components/documents/TaxAxisDocuments.d.ts +7 -1
  17. package/lib/tax-axis/components/documents/TaxAxisDocuments.js +116 -53
  18. package/lib/tax-axis/components/extractionReview/TaxAxisExtractionReview.js +17 -17
  19. package/lib/tax-axis/components/intake/ClientParametersSection.js +1 -1
  20. package/lib/tax-axis/components/intake/intakeSchema.js +1 -1
  21. package/lib/tax-axis/components/preparerWorkpaper/TaxAxisPreparerWorkpaper.d.ts +6 -2
  22. package/lib/tax-axis/components/preparerWorkpaper/TaxAxisPreparerWorkpaper.js +5 -3
  23. package/lib/tax-axis/index.d.ts +4 -0
  24. package/lib/tax-axis/index.js +6 -1
  25. package/lib/tax-axis/lib/adapters/useEngineOutput.d.ts +144 -0
  26. package/lib/tax-axis/lib/adapters/useEngineOutput.js +155 -0
  27. package/lib/tax-axis/lib/data/documents.d.ts +3 -2
  28. package/lib/tax-axis/lib/data/documents.js +225 -25
  29. package/lib/tax-axis/lib/documentFieldCatalog.d.ts +13 -0
  30. package/lib/tax-axis/lib/documentFieldCatalog.js +808 -0
  31. package/lib/tax-axis/lib/types/index.d.ts +3 -0
  32. package/package.json +1 -1
@@ -49,8 +49,8 @@ const Chevron = () => (react_1.default.createElement("svg", { className: "absolu
49
49
  react_1.default.createElement("path", { d: "M3 4.5l3 3 3-3", stroke: "#E6E8F5", strokeWidth: "1.5", strokeLinecap: "round" })));
50
50
  /* ═══ Option lists (spec-canonical) ═══ */
51
51
  const ENTITY_OPTIONS = [
52
- "S-Corporation",
53
52
  "C-Corporation",
53
+ "S-Corporation",
54
54
  "LLC",
55
55
  "Partnership",
56
56
  "Sole Proprietor",
@@ -60,7 +60,7 @@ exports.intakeSchema = Yup.object().shape({
60
60
  exports.intakeDefaultValues = {
61
61
  bizName: "",
62
62
  cpaName: "",
63
- entity: "S-Corporation",
63
+ entity: "C-Corporation",
64
64
  industry: "Professional Services",
65
65
  revenue: "",
66
66
  netIncome: "",
@@ -1,9 +1,13 @@
1
1
  import React from "react";
2
- import type { ClientProfile } from "../../lib/types";
2
+ import type { ClientProfile, Strategy, ComputedMap } from "../../lib/types";
3
3
  import type { TaxAxisScreenProps } from "../../lib/types";
4
4
  export interface TaxAxisPreparerWorkpaperProps extends TaxAxisScreenProps {
5
5
  profile: ClientProfile;
6
6
  onBack: () => void;
7
7
  onToggleToClient?: () => void;
8
+ /** When provided, bypasses local filterEligibleStrategies + computeAllStrategies. */
9
+ liveStrategies?: Strategy[];
10
+ /** When provided, bypasses local computeAllStrategies. Must accompany liveStrategies. */
11
+ liveComputedMap?: ComputedMap;
8
12
  }
9
- export declare function TaxAxisPreparerWorkpaper({ profile, onBack, onToggleToClient }: TaxAxisPreparerWorkpaperProps): React.JSX.Element;
13
+ export declare function TaxAxisPreparerWorkpaper({ profile, onBack, onToggleToClient, liveStrategies, liveComputedMap }: TaxAxisPreparerWorkpaperProps): React.JSX.Element;
@@ -32,12 +32,14 @@ const ReportToolbar_1 = require("../shared/ReportToolbar");
32
32
  const EngagementHeader_1 = require("./EngagementHeader");
33
33
  const Section6694Summary_1 = require("./Section6694Summary");
34
34
  const PriorityGroup_1 = require("./PriorityGroup");
35
- function TaxAxisPreparerWorkpaper({ profile, onBack, onToggleToClient }) {
35
+ function TaxAxisPreparerWorkpaper({ profile, onBack, onToggleToClient, liveStrategies, liveComputedMap }) {
36
36
  const [expanded, setExpanded] = (0, react_1.useState)({});
37
37
  const [printMode, setPrintMode] = (0, react_1.useState)(false);
38
38
  const toggle = (rank, section) => setExpanded(prev => (Object.assign(Object.assign({}, prev), { [rank + "-" + section]: !prev[rank + "-" + section] })));
39
- const eligible = (0, react_1.useMemo)(() => (0, compute_1.filterEligibleStrategies)(profile), [profile]);
40
- const computed = (0, react_1.useMemo)(() => (0, compute_1.computeAllStrategies)(profile), [profile]);
39
+ const staticEligible = (0, react_1.useMemo)(() => (0, compute_1.filterEligibleStrategies)(profile), [profile]);
40
+ const staticComputed = (0, react_1.useMemo)(() => (0, compute_1.computeAllStrategies)(profile), [profile]);
41
+ const eligible = liveStrategies !== null && liveStrategies !== void 0 ? liveStrategies : staticEligible;
42
+ const computed = liveComputedMap !== null && liveComputedMap !== void 0 ? liveComputedMap : staticComputed;
41
43
  const states = profile.states || [];
42
44
  const bizName = profile.bizName || "Client";
43
45
  const rev = parseInt((profile.revenue || "0").replace(/,/g, "")) || 0;
@@ -5,10 +5,14 @@ export { SectionHeader } from "./components/shared/SectionHeader";
5
5
  export * from "./lib/types";
6
6
  export * from "./lib/data";
7
7
  export * from "./lib/compute";
8
+ export { useEngineOutput } from "./lib/adapters/useEngineOutput";
9
+ export type { EngineOutput, EngineOutputAdapterResult, EngineStrategyAnalysis, EngineCpaWorkflow } from "./lib/adapters/useEngineOutput";
8
10
  export { TaxAxisIntake } from "./components/intake/TaxAxisIntake";
9
11
  export type { TaxAxisIntakeProps } from "./components/intake/TaxAxisIntake";
10
12
  export { TaxAxisDocuments } from "./components/documents/TaxAxisDocuments";
11
13
  export type { TaxAxisDocumentsProps } from "./components/documents/TaxAxisDocuments";
14
+ export { DocumentReviewModal } from "./components/documents/DocumentReviewModal";
15
+ export type { DocumentReviewModalProps } from "./components/documents/DocumentReviewModal";
12
16
  export { TaxAxisProcessing } from "./components/processing/TaxAxisProcessing";
13
17
  export type { TaxAxisProcessingProps } from "./components/processing/TaxAxisProcessing";
14
18
  export { TaxAxisDashboard } from "./components/dashboard/TaxAxisDashboard";
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.TaxAxisPresentationMode = exports.TaxAxisProspectReport = exports.TaxAxisExtractionReview = exports.TaxAxisPreparerWorkpaper = exports.TaxAxisClientReport = exports.TaxAxisDashboard = exports.TaxAxisProcessing = exports.TaxAxisDocuments = exports.TaxAxisIntake = exports.SectionHeader = exports.TaxAxisButton = exports.TaxAxisBadge = exports.TaxAxisCard = void 0;
17
+ exports.TaxAxisPresentationMode = exports.TaxAxisProspectReport = exports.TaxAxisExtractionReview = exports.TaxAxisPreparerWorkpaper = exports.TaxAxisClientReport = exports.TaxAxisDashboard = exports.TaxAxisProcessing = exports.DocumentReviewModal = exports.TaxAxisDocuments = exports.TaxAxisIntake = exports.useEngineOutput = exports.SectionHeader = exports.TaxAxisButton = exports.TaxAxisBadge = exports.TaxAxisCard = void 0;
18
18
  // Shared primitives
19
19
  var TaxAxisCard_1 = require("./components/shared/TaxAxisCard");
20
20
  Object.defineProperty(exports, "TaxAxisCard", { enumerable: true, get: function () { return TaxAxisCard_1.TaxAxisCard; } });
@@ -30,11 +30,16 @@ __exportStar(require("./lib/types"), exports);
30
30
  __exportStar(require("./lib/data"), exports);
31
31
  // Compute
32
32
  __exportStar(require("./lib/compute"), exports);
33
+ // Adapters
34
+ var useEngineOutput_1 = require("./lib/adapters/useEngineOutput");
35
+ Object.defineProperty(exports, "useEngineOutput", { enumerable: true, get: function () { return useEngineOutput_1.useEngineOutput; } });
33
36
  // Screens
34
37
  var TaxAxisIntake_1 = require("./components/intake/TaxAxisIntake");
35
38
  Object.defineProperty(exports, "TaxAxisIntake", { enumerable: true, get: function () { return TaxAxisIntake_1.TaxAxisIntake; } });
36
39
  var TaxAxisDocuments_1 = require("./components/documents/TaxAxisDocuments");
37
40
  Object.defineProperty(exports, "TaxAxisDocuments", { enumerable: true, get: function () { return TaxAxisDocuments_1.TaxAxisDocuments; } });
41
+ var DocumentReviewModal_1 = require("./components/documents/DocumentReviewModal");
42
+ Object.defineProperty(exports, "DocumentReviewModal", { enumerable: true, get: function () { return DocumentReviewModal_1.DocumentReviewModal; } });
38
43
  var TaxAxisProcessing_1 = require("./components/processing/TaxAxisProcessing");
39
44
  Object.defineProperty(exports, "TaxAxisProcessing", { enumerable: true, get: function () { return TaxAxisProcessing_1.TaxAxisProcessing; } });
40
45
  var TaxAxisDashboard_1 = require("./components/dashboard/TaxAxisDashboard");
@@ -0,0 +1,144 @@
1
+ import type { Strategy, ComputedMap } from "../types";
2
+ export interface EngineCalculationTrace {
3
+ strategy_id: string;
4
+ branch_executed: string | null;
5
+ formula: string;
6
+ inputs: Record<string, unknown>;
7
+ result_gross: number | null;
8
+ confidence_interval: {
9
+ low: number;
10
+ high: number;
11
+ basis: string;
12
+ } | null;
13
+ position_strength: string;
14
+ irs_cite: string;
15
+ data_quality_flag: string | null;
16
+ forms_required: string[];
17
+ deadline_flag: string | null;
18
+ amt_flag: boolean;
19
+ }
20
+ export interface EngineStrategyAnalysis {
21
+ strategy_id: string;
22
+ strategy_name: string;
23
+ priority_tier: "HIGH" | "MEDIUM" | "LOW" | "NOT_RECOMMENDED";
24
+ weighted_score: number;
25
+ scores: {
26
+ financial_impact: number;
27
+ applicability: number;
28
+ complexity: number;
29
+ risk: number;
30
+ cash_flow: number;
31
+ };
32
+ quick_win: boolean;
33
+ calculation_trace: EngineCalculationTrace;
34
+ engagement_recommendation: string;
35
+ risk_disclosure: string | null;
36
+ }
37
+ export interface EngineClientSummaryStrategy {
38
+ slot: number;
39
+ strategy_name: string;
40
+ savings_range: string;
41
+ why_it_applies: string;
42
+ next_step: string;
43
+ quick_win_badge: boolean;
44
+ deadline_flag?: string | null;
45
+ }
46
+ export interface EngineCpaWorkflow {
47
+ workpaper_codes: string[] | null;
48
+ section_6694_notices: Array<{
49
+ strategy_id: string;
50
+ position_strength: string;
51
+ notice: string;
52
+ }>;
53
+ prior_year_flags: string[];
54
+ conflict_of_interest_checklist: Array<{
55
+ strategy_id: string;
56
+ conflict_prompt: string;
57
+ confirmed_no_conflict: boolean;
58
+ }>;
59
+ engagement_recommendations: string[];
60
+ }
61
+ export interface EngineOutput {
62
+ engagement_id: string;
63
+ generated_at: string;
64
+ algorithm_version: string;
65
+ business_profile: {
66
+ entity_type: string;
67
+ industry: string;
68
+ industry_vertical: string;
69
+ states: string[];
70
+ data_years: number;
71
+ confidence_tier: string;
72
+ effective_tax_rate: number | null;
73
+ data_quality_flags: string[];
74
+ };
75
+ eligibility_screening: {
76
+ excluded_strategies: Array<{
77
+ strategy_id: string;
78
+ status: "EXCLUDED";
79
+ reason: string;
80
+ irs_cite: string;
81
+ }>;
82
+ };
83
+ strategy_analysis: EngineStrategyAnalysis[];
84
+ strategy_interaction_warnings: Array<{
85
+ strategy_pair: [string, string];
86
+ warning_text: string;
87
+ }>;
88
+ implementation_roadmap: {
89
+ quick_wins: Array<{
90
+ strategy_id: string;
91
+ action: string;
92
+ deadline?: string | null;
93
+ }>;
94
+ immediate: Array<{
95
+ strategy_id: string;
96
+ action: string;
97
+ deadline?: string | null;
98
+ }>;
99
+ thirty_day: Array<{
100
+ strategy_id: string;
101
+ action: string;
102
+ deadline?: string | null;
103
+ }>;
104
+ ninety_day: Array<{
105
+ strategy_id: string;
106
+ action: string;
107
+ deadline?: string | null;
108
+ }>;
109
+ annual: Array<{
110
+ strategy_id: string;
111
+ action: string;
112
+ deadline?: string | null;
113
+ }>;
114
+ };
115
+ cpa_workflow: EngineCpaWorkflow;
116
+ client_summary: {
117
+ opening: string;
118
+ strategies: EngineClientSummaryStrategy[];
119
+ data_quality_note: string | null;
120
+ interaction_warning: string | null;
121
+ closing: string;
122
+ };
123
+ risk_disclosures: string[];
124
+ client_risk_disclosures: {
125
+ accuracy_penalty_warning: string | null;
126
+ applies_to_strategies: string[];
127
+ };
128
+ amt_flags: Array<{
129
+ trigger: string;
130
+ strategy_id: string;
131
+ flag_text: string;
132
+ }>;
133
+ nexus_flags: Array<{
134
+ state: string;
135
+ nexus_type: string;
136
+ flag_text: string;
137
+ }>;
138
+ }
139
+ export interface EngineOutputAdapterResult {
140
+ strategies: Strategy[];
141
+ computedMap: ComputedMap;
142
+ engineOutput: EngineOutput;
143
+ }
144
+ export declare function useEngineOutput(engineOutput: EngineOutput | null | undefined): EngineOutputAdapterResult | null;
@@ -0,0 +1,155 @@
1
+ "use strict";
2
+ // ═══════════════════════════════════════════════════════════════════
3
+ // useEngineOutput — adapts live EngineOutput from paro-graphql-api
4
+ // into the Strategy[] + ComputedMap shapes the FE components consume.
5
+ //
6
+ // Strategy: use the static STRATEGIES catalog as a structural template
7
+ // (rank, cat, entities, authority, etc.) and override savings/priority/score
8
+ // from the live engine data. Falls back to static data when a strategy_id
9
+ // has no match in the catalog (future-proofing for new strategies).
10
+ // ═══════════════════════════════════════════════════════════════════
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.useEngineOutput = useEngineOutput;
13
+ const react_1 = require("react");
14
+ const data_1 = require("../data");
15
+ // ── Strategy ID → rank mapping (S1..S26 → rank 1..25 catalog) ───────
16
+ // Maps engine strategy_ids like "S2", "S5" etc. to catalog ranks.
17
+ // Built once from the static STRATEGIES array by matching code/name heuristics.
18
+ const ENGINE_ID_TO_RANK = {
19
+ S1: 1, // Business Entity Structure (S-Corp election)
20
+ S2: 2, // Section 179
21
+ S3: 3, // Bonus Depreciation §168(k)
22
+ S4: 4, // QBI §199A
23
+ S5: 5, // R&D Credit §41
24
+ S6: 6, // WOTC §51
25
+ S7: 7, // Retirement Plan
26
+ S8: 8, // Cost Segregation
27
+ S9: 9, // HSA
28
+ S10: 10, // Business Meals
29
+ S11: 11, // Professional Services / Legal
30
+ S12: 12, // Home Office
31
+ S13: 13, // Health Care Credit §45R
32
+ S14: 14, // Charitable / DAF
33
+ S15: 15, // SALT PTE
34
+ S16: 16, // §163(j) Interest
35
+ S17: 17, // Income Deferral
36
+ S18: 18, // Opportunity Zone §1400Z
37
+ S19: 19, // §179D Energy
38
+ S20: 20, // Accounting Method
39
+ S21: 21, // OBBBA Overtime
40
+ S22: 22, // OBBBA Tips / Overtime
41
+ S23: 23, // §174A R&E catch-up
42
+ S24: 24, // Childcare §45F
43
+ S25: 25, // OBBBA Trump Accounts
44
+ };
45
+ const CATALOG_BY_RANK = new Map(data_1.STRATEGIES.map((s) => [s.rank, s]));
46
+ // ── Priority tier mapping ─────────────────────────────────────────────
47
+ function mapPriority(tier, quickWin) {
48
+ if (quickWin)
49
+ return "QUICK WIN";
50
+ if (tier === "HIGH")
51
+ return "HIGH";
52
+ if (tier === "MEDIUM")
53
+ return "MEDIUM";
54
+ if (tier === "LOW")
55
+ return "LOW";
56
+ return "NOT RECOMMENDED";
57
+ }
58
+ // ── Timeline bucket from implementation_roadmap ───────────────────────
59
+ function resolveTimelineBucket(strategyId, roadmap) {
60
+ if (roadmap.quick_wins.some((r) => r.strategy_id === strategyId))
61
+ return "now";
62
+ if (roadmap.immediate.some((r) => r.strategy_id === strategyId))
63
+ return "now";
64
+ if (roadmap.thirty_day.some((r) => r.strategy_id === strategyId))
65
+ return "30d";
66
+ if (roadmap.ninety_day.some((r) => r.strategy_id === strategyId))
67
+ return "90d";
68
+ if (roadmap.annual.some((r) => r.strategy_id === strategyId))
69
+ return "filing";
70
+ return "filing";
71
+ }
72
+ // ── CalculationTrace → StrategyTraceStep[] ───────────────────────────
73
+ function traceFromEngine(trace) {
74
+ const steps = [];
75
+ // Emit formula as step 1
76
+ if (trace.formula) {
77
+ steps.push({
78
+ n: 1,
79
+ step: "Formula",
80
+ formula: trace.formula,
81
+ result: trace.result_gross != null ? `$${trace.result_gross.toLocaleString()}` : "See CI",
82
+ src: trace.irs_cite || "",
83
+ });
84
+ }
85
+ // Emit confidence interval as step 2 when present
86
+ if (trace.confidence_interval) {
87
+ steps.push({
88
+ n: 2,
89
+ step: "Confidence range",
90
+ formula: `Low × ${trace.confidence_interval.basis}`,
91
+ result: `$${trace.confidence_interval.low.toLocaleString()} – $${trace.confidence_interval.high.toLocaleString()}`,
92
+ src: trace.irs_cite || "",
93
+ });
94
+ }
95
+ return steps;
96
+ }
97
+ function adaptEngineOutput(engineOutput) {
98
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
99
+ const strategies = [];
100
+ const computedMap = new Map();
101
+ for (const analysis of engineOutput.strategy_analysis) {
102
+ if (analysis.priority_tier === "NOT_RECOMMENDED")
103
+ continue;
104
+ const rank = ENGINE_ID_TO_RANK[analysis.strategy_id];
105
+ const template = rank != null ? CATALOG_BY_RANK.get(rank) : undefined;
106
+ const trace = analysis.calculation_trace;
107
+ const ci = trace === null || trace === void 0 ? void 0 : trace.confidence_interval;
108
+ const lo = (_b = (_a = ci === null || ci === void 0 ? void 0 : ci.low) !== null && _a !== void 0 ? _a : template === null || template === void 0 ? void 0 : template.lo) !== null && _b !== void 0 ? _b : 0;
109
+ const hi = (_d = (_c = ci === null || ci === void 0 ? void 0 : ci.high) !== null && _c !== void 0 ? _c : template === null || template === void 0 ? void 0 : template.hi) !== null && _d !== void 0 ? _d : 0;
110
+ const timelineBucket = resolveTimelineBucket(analysis.strategy_id, engineOutput.implementation_roadmap);
111
+ const strategy = {
112
+ rank: rank !== null && rank !== void 0 ? rank : 99,
113
+ code: (_e = template === null || template === void 0 ? void 0 : template.code) !== null && _e !== void 0 ? _e : analysis.strategy_id,
114
+ name: analysis.strategy_name,
115
+ cat: (_f = template === null || template === void 0 ? void 0 : template.cat) !== null && _f !== void 0 ? _f : "deductions",
116
+ priority: mapPriority(analysis.priority_tier, analysis.quick_win),
117
+ score: Math.round(analysis.weighted_score),
118
+ entities: (_g = template === null || template === void 0 ? void 0 : template.entities) !== null && _g !== void 0 ? _g : ["S-Corporation", "C-Corporation", "Partnership/LLC", "Sole Proprietorship"],
119
+ lo,
120
+ hi,
121
+ timeline: (_h = template === null || template === void 0 ? void 0 : template.timeline) !== null && _h !== void 0 ? _h : timelineBucket,
122
+ timelineBucket,
123
+ authority: (_j = trace === null || trace === void 0 ? void 0 : trace.irs_cite) !== null && _j !== void 0 ? _j : template === null || template === void 0 ? void 0 : template.authority,
124
+ forms: (_l = (_k = trace === null || trace === void 0 ? void 0 : trace.forms_required) === null || _k === void 0 ? void 0 : _k.join(", ")) !== null && _l !== void 0 ? _l : template === null || template === void 0 ? void 0 : template.forms,
125
+ warning: (_o = (_m = analysis.risk_disclosure) !== null && _m !== void 0 ? _m : template === null || template === void 0 ? void 0 : template.warning) !== null && _o !== void 0 ? _o : null,
126
+ abstract: analysis.engagement_recommendation,
127
+ trace: traceFromEngine(trace),
128
+ needsPTE: template === null || template === void 0 ? void 0 : template.needsPTE,
129
+ onlyIndustry: template === null || template === void 0 ? void 0 : template.onlyIndustry,
130
+ excludeIndustry: template === null || template === void 0 ? void 0 : template.excludeIndustry,
131
+ preferIndustry: template === null || template === void 0 ? void 0 : template.preferIndustry,
132
+ minEmployees: template === null || template === void 0 ? void 0 : template.minEmployees,
133
+ needsOwnerComp: template === null || template === void 0 ? void 0 : template.needsOwnerComp,
134
+ clientBrief: (_q = (_p = engineOutput.client_summary.strategies.find((cs) => cs.strategy_name === analysis.strategy_name)) === null || _p === void 0 ? void 0 : _p.why_it_applies) !== null && _q !== void 0 ? _q : template === null || template === void 0 ? void 0 : template.clientBrief,
135
+ action: (_s = (_r = engineOutput.client_summary.strategies.find((cs) => cs.strategy_name === analysis.strategy_name)) === null || _r === void 0 ? void 0 : _r.next_step) !== null && _s !== void 0 ? _s : template === null || template === void 0 ? void 0 : template.action,
136
+ };
137
+ strategies.push(strategy);
138
+ computedMap.set(strategy.rank, {
139
+ lo,
140
+ hi,
141
+ trace: strategy.trace,
142
+ });
143
+ }
144
+ // Sort by weighted_score descending (same ordering the FE uses)
145
+ strategies.sort((a, b) => b.score - a.score);
146
+ return { strategies, computedMap, engineOutput };
147
+ }
148
+ // ── React hook ────────────────────────────────────────────────────────
149
+ function useEngineOutput(engineOutput) {
150
+ return (0, react_1.useMemo)(() => {
151
+ if (!engineOutput)
152
+ return null;
153
+ return adaptEngineOutput(engineOutput);
154
+ }, [engineOutput]);
155
+ }
@@ -1,3 +1,4 @@
1
- import type { ClientProfile, DocSpec } from "../types";
1
+ import { DocSpec } from "../types";
2
+ export type TaxAxisEntityTypeKey = "S_CORP" | "C_CORP" | "PARTNERSHIP" | "LLC" | "SOLE_PROP";
2
3
  export declare const DOC_SPECS_BASE: DocSpec[];
3
- export declare function getDocSpecs(profile?: ClientProfile): DocSpec[];
4
+ export declare function getDocSpecs(entityType?: TaxAxisEntityTypeKey | string | null): DocSpec[];