projectionlab-mcp 1.2.1 → 1.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/HOW-IT-WORKS.md +7 -6
- package/MANUAL-SETUP.md +8 -4
- package/README.md +1 -1
- package/REFERENCE.md +27 -11
- package/SETUP-FOR-AGENTS.md +4 -4
- package/dist/bootstrap.js +15 -3
- package/dist/bootstrap.js.map +1 -1
- package/dist/bridge.d.ts +34 -5
- package/dist/config.d.ts +0 -1
- package/dist/config.js +0 -2
- package/dist/config.js.map +1 -1
- package/dist/currentFinances.d.ts +60 -0
- package/dist/currentFinances.js +117 -2
- package/dist/currentFinances.js.map +1 -1
- package/dist/dataModel.d.ts +37 -8
- package/dist/dataModel.js +1138 -15
- package/dist/dataModel.js.map +1 -1
- package/dist/diff.d.ts +18 -10
- package/dist/diff.js +142 -20
- package/dist/diff.js.map +1 -1
- package/dist/editAccess.d.ts +15 -0
- package/dist/editAccess.js +29 -0
- package/dist/editAccess.js.map +1 -0
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/extensionBridge.d.ts +99 -10
- package/dist/extensionBridge.js +445 -48
- package/dist/extensionBridge.js.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/instructions.d.ts +1 -1
- package/dist/instructions.js +1 -1
- package/dist/layout.d.ts +68 -0
- package/dist/layout.js +122 -0
- package/dist/layout.js.map +1 -0
- package/dist/pathPatch.d.ts +41 -3
- package/dist/pathPatch.js +162 -14
- package/dist/pathPatch.js.map +1 -1
- package/dist/planSettings.d.ts +21 -2
- package/dist/planSettings.js +30 -6
- package/dist/planSettings.js.map +1 -1
- package/dist/planVersion.d.ts +13 -6
- package/dist/planVersion.js +33 -15
- package/dist/planVersion.js.map +1 -1
- package/dist/plans.d.ts +24 -3
- package/dist/plans.js +55 -2
- package/dist/plans.js.map +1 -1
- package/dist/realEstate.d.ts +20 -0
- package/dist/realEstate.js +57 -0
- package/dist/realEstate.js.map +1 -1
- package/dist/redact.d.ts +20 -0
- package/dist/redact.js +62 -0
- package/dist/redact.js.map +1 -1
- package/dist/resources/dataModel.d.ts +6 -2
- package/dist/resources/dataModel.js +86 -16
- package/dist/resources/dataModel.js.map +1 -1
- package/dist/resources/knowledge.d.ts +7 -1
- package/dist/resources/knowledge.js +262 -14
- package/dist/resources/knowledge.js.map +1 -1
- package/dist/resources/layoutResource.d.ts +19 -0
- package/dist/resources/layoutResource.js +43 -0
- package/dist/resources/layoutResource.js.map +1 -0
- package/dist/resources/planData.js +1 -1
- package/dist/resources/planData.js.map +1 -1
- package/dist/snapshot.d.ts +2 -1
- package/dist/snapshot.js +3 -1
- package/dist/snapshot.js.map +1 -1
- package/dist/summary.d.ts +39 -2
- package/dist/summary.js +148 -31
- package/dist/summary.js.map +1 -1
- package/dist/tools/bootstrap.js +2 -1
- package/dist/tools/bootstrap.js.map +1 -1
- package/dist/tools/clonePlan.js +10 -11
- package/dist/tools/clonePlan.js.map +1 -1
- package/dist/tools/connection.js +8 -8
- package/dist/tools/connection.js.map +1 -1
- package/dist/tools/deletePlan.js +9 -10
- package/dist/tools/deletePlan.js.map +1 -1
- package/dist/tools/diff.js +54 -15
- package/dist/tools/diff.js.map +1 -1
- package/dist/tools/export.js +5 -5
- package/dist/tools/export.js.map +1 -1
- package/dist/tools/getCurrentFinances.js +80 -24
- package/dist/tools/getCurrentFinances.js.map +1 -1
- package/dist/tools/getPlan.js +7 -1
- package/dist/tools/getPlan.js.map +1 -1
- package/dist/tools/getPlanSection.js +10 -3
- package/dist/tools/getPlanSection.js.map +1 -1
- package/dist/tools/getPlanSettings.js +16 -4
- package/dist/tools/getPlanSettings.js.map +1 -1
- package/dist/tools/restore.d.ts +4 -3
- package/dist/tools/restore.js +82 -44
- package/dist/tools/restore.js.map +1 -1
- package/dist/tools/schema.js +100 -22
- package/dist/tools/schema.js.map +1 -1
- package/dist/tools/snapshots.js +47 -21
- package/dist/tools/snapshots.js.map +1 -1
- package/dist/tools/summary.js +34 -1
- package/dist/tools/summary.js.map +1 -1
- package/dist/tools/updateAccount.js +69 -26
- package/dist/tools/updateAccount.js.map +1 -1
- package/dist/tools/updatePlanEvent.js +49 -29
- package/dist/tools/updatePlanEvent.js.map +1 -1
- package/dist/tools/updatePlanSection.js +10 -10
- package/dist/tools/updatePlanSection.js.map +1 -1
- package/dist/tools/updatePlanSettings.js +33 -15
- package/dist/tools/updatePlanSettings.js.map +1 -1
- package/dist/tools/writeGuard.d.ts +11 -0
- package/dist/tools/writeGuard.js +17 -0
- package/dist/tools/writeGuard.js.map +1 -0
- package/dist/types/projectionlab.d.ts +4 -0
- package/dist/types/wire.d.ts +81 -8
- package/dist/types/wire.js +30 -2
- package/dist/types/wire.js.map +1 -1
- package/package.json +1 -1
- package/skills/projectionlab/SKILL.md +222 -20
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { registerLayoutResource } from "./layoutResource.js";
|
|
2
|
+
export const KNOWLEDGE_V4 = `# ProjectionLab & FIRE Reference
|
|
2
3
|
|
|
3
4
|
Curated concepts for analyzing retirement plans through this MCP server.
|
|
4
5
|
|
|
@@ -19,6 +20,13 @@ describe the current release, 4.6.0
|
|
|
19
20
|
Analytics). Never state a yearly figure from memory: they change every year.
|
|
20
21
|
Ask the user to read the current one in ProjectionLab.
|
|
21
22
|
|
|
23
|
+
## Evidence legend
|
|
24
|
+
|
|
25
|
+
When evaluating plan elements or answering user questions, anchor claims with tags:
|
|
26
|
+
- **[EXACT]**: Verified directly from plan JSON via tool inspection or output.
|
|
27
|
+
- **[INFERRED]**: Derived logically from adjacent plan data or standard rule interactions.
|
|
28
|
+
- **[ASSUMPTION]**: A placeholder, default, or external benchmark where plan data is absent.
|
|
29
|
+
|
|
22
30
|
## ProjectionLab data model (quick map)
|
|
23
31
|
|
|
24
32
|
- **plans[]**: each plan is a milestone-driven simulation.
|
|
@@ -221,22 +229,262 @@ financial terms: https://projectionlab.com/financial-terms
|
|
|
221
229
|
Current Finances through the Plugin API, which has to be enabled in account
|
|
222
230
|
settings. This server uses that same API.
|
|
223
231
|
`;
|
|
224
|
-
export
|
|
225
|
-
|
|
232
|
+
export const KNOWLEDGE = KNOWLEDGE_V4;
|
|
233
|
+
export const KNOWLEDGE_V5 = `# ProjectionLab 5 & FIRE Reference
|
|
234
|
+
|
|
235
|
+
Curated concepts for analyzing retirement plans through this MCP server on ProjectionLab 5.
|
|
236
|
+
|
|
237
|
+
ProjectionLab 5 operates under Plugin API contract 2, using a multi-document export envelope.
|
|
238
|
+
|
|
239
|
+
## How to use this reference
|
|
240
|
+
|
|
241
|
+
- **Explain, do not recommend.** Say what a term means, what ProjectionLab does
|
|
242
|
+
with it, and what the user can look at in the app to decide. Do not tell the
|
|
243
|
+
user what to do with their money and do not predict a personal outcome. This
|
|
244
|
+
is information and education, not personalized financial advice; the decision
|
|
245
|
+
belongs to the user and a licensed professional.
|
|
246
|
+
- **Concepts only; ProjectionLab owns the yearly figures.** The app applies the
|
|
247
|
+
current tax brackets, standard deduction, IRMAA tiers, RMD ages, contribution
|
|
248
|
+
limits and ACA subsidies, and the user sees those numbers in the app (Tax
|
|
249
|
+
Analytics). Never state a yearly figure from memory: they change every year.
|
|
250
|
+
Ask the user to read the current one in ProjectionLab.
|
|
251
|
+
|
|
252
|
+
## Evidence legend
|
|
253
|
+
|
|
254
|
+
Data model entries for ProjectionLab 5 carry the tag \`[export-shape]\`, meaning the field and its value type appear in a ProjectionLab 5 export; its meaning is not yet confirmed by a stored-value test.
|
|
255
|
+
|
|
256
|
+
When evaluating plan elements or answering user questions, anchor claims with tags:
|
|
257
|
+
- **[EXACT]**: Verified directly from plan JSON via tool inspection or output.
|
|
258
|
+
- **[INFERRED]**: Derived logically from adjacent plan data or standard rule interactions.
|
|
259
|
+
- **[ASSUMPTION]**: A placeholder, default, or external benchmark where plan data is absent.
|
|
260
|
+
|
|
261
|
+
## ProjectionLab 5 data model (quick map)
|
|
262
|
+
|
|
263
|
+
- **Root envelope**: \`{ schema: 1, exportedAt, documents: { currentFinances, plans, settings, accountHistory } }\`.
|
|
264
|
+
Each document carries its own internal \`schema\` version.
|
|
265
|
+
- **documents.currentFinances**: actual financial state and baseline balance sheet.
|
|
266
|
+
- **household**: member demographics under \`household.people.me\` and \`household.people.spouse\`,
|
|
267
|
+
with partnership filing status under \`household.partnerStatus\`.
|
|
268
|
+
- **accounts**: all financial accounts, debts, and real property, stored as a map keyed by account ID.
|
|
269
|
+
- Each record carries a \`kind\` discriminator: \`"account"\` (cash, investment, and retirement accounts
|
|
270
|
+
with \`balance\` and \`costBasis\`), \`"debt"\` (liabilities with \`balance\` and optional \`securedByAssetId\`),
|
|
271
|
+
or \`"real-asset"\` (physical property with \`value\` and \`purchasePrice\`).
|
|
272
|
+
- Archived accounts carry an \`archivedOn\` ISO date string.
|
|
273
|
+
- Supported account types: the Solo 401k, Roth Solo 401k, and SEP IRA account types store as
|
|
274
|
+
\`"401k"\` or \`"roth-401k"\` with \`subtype: "solo"\`, and \`"ira"\` with \`subtype: "sep"\`.
|
|
275
|
+
Observed type strings include \`"taxable"\`, \`"401k"\`, \`"savings"\`, \`"land"\`, and \`"secured-loan"\`.
|
|
276
|
+
- **documents.plans[]**: milestone-driven simulation plans.
|
|
277
|
+
- Plans carry no \`active\` flag. \`settings.plan.activeId\` and \`settings.plan.baselineId\` are
|
|
278
|
+
reported as stored; no plan is treated as the selected plan.
|
|
279
|
+
- Every plan event item carries a \`kind\` discriminator: \`"account"\`, \`"real-asset"\`,
|
|
280
|
+
\`"income"\`, \`"expense"\`, or \`"priority"\`.
|
|
281
|
+
- Timing for event start and end is defined by structured objects:
|
|
282
|
+
\`{ type: "date" | "milestone" | "keyword", value, modifier? }\`.
|
|
283
|
+
- **milestones[]**: lifecycle events (retirement, Medicare, death) triggered by date, year, age,
|
|
284
|
+
or milestone-relative criteria. Other events anchor timing to milestone IDs.
|
|
285
|
+
- **income.events[]**: salary, pensions, social security, other income.
|
|
286
|
+
- **expenses.events[]**: living expenses carrying a \`spendingType\` (\`"essential"\` vs \`"discretionary"\`).
|
|
287
|
+
- **accounts.events[]**: plan investment accounts, linking to Current Finances via \`accountId\`.
|
|
288
|
+
- **assets.events[]**: real estate and physical assets with appreciation and depreciation, linking
|
|
289
|
+
to Current Finances via \`assetId\`.
|
|
290
|
+
- **variables**: tax settings, inflation, returns, drawdown order, IRMAA, estate rules.
|
|
291
|
+
- **withdrawalStrategy**: alternative withdrawal policy mode (such as fixed percentage or Guyton-Klinger).
|
|
292
|
+
- **montecarlo**: Chance of Success simulation parameters.
|
|
293
|
+
- **priorities.events[]**: savings contribution ordering and cash flow routing. A priority's
|
|
294
|
+
\`accountId\` is the id of the plan account event it routes cash to, not a Current Finances account id.
|
|
295
|
+
- Event names need not be unique within a section; address an event by id when its name is ambiguous.
|
|
296
|
+
- **documents.settings**:
|
|
297
|
+
- **plan**: viewing preferences including \`activeId\` and \`baselineId\` (reported as stored),
|
|
298
|
+
the account's year alignment (\`alignment.type\`: \`"calendar"\`, \`"rolling"\`, \`"au-tax"\`,
|
|
299
|
+
\`"uk-tax"\` or \`"custom"\`), and pinned tabs. A plan can override the alignment in
|
|
300
|
+
\`variables.alignment\`; null or absent means it follows the account.
|
|
301
|
+
- **plugins**: plugin configuration with \`enabled\` status and \`apiKey\` (authentication secret,
|
|
302
|
+
redacted on reads; sits at \`documents.settings.plugins.apiKey\`).
|
|
303
|
+
- **documents.accountHistory**:
|
|
304
|
+
- End-of-year balances, tax cost basis, and asset values tracked by account ID and calendar year
|
|
305
|
+
under \`documents.accountHistory.<accountId>.<year>\`. Replaces the separate progress section.
|
|
306
|
+
- Simulation math and Chance of Success trials run only in the ProjectionLab UI.
|
|
307
|
+
This server reads the plan and financial definitions; it does not compute projections.
|
|
308
|
+
|
|
309
|
+
## Plan-change outcome metrics
|
|
310
|
+
|
|
311
|
+
Evaluate a plan change primarily with ProjectionLab's projected ending net worth
|
|
312
|
+
and Chance of Success from a completed simulation. Current Finances net worth is
|
|
313
|
+
an input balance sheet, not an outcome. Mutation before/after values verify that
|
|
314
|
+
the requested input changed; they do not measure its financial impact. The
|
|
315
|
+
Plugin API currently does not expose a supported calculation/result method, so
|
|
316
|
+
recalculate both outcomes in the UI after applying a change.
|
|
317
|
+
|
|
318
|
+
## Account tax vocabulary
|
|
319
|
+
|
|
320
|
+
Use three words for every account, and use them consistently:
|
|
321
|
+
|
|
322
|
+
- **taxable**: funded with after-tax money; interest, dividends and gains are
|
|
323
|
+
taxed in the year they are received.
|
|
324
|
+
- **tax-deferred**: traditional 401(k) and IRA. Contributions lower taxable
|
|
325
|
+
income now; withdrawals are taxed as ordinary income later.
|
|
326
|
+
- **tax-free**: Roth accounts, and an HSA spent on healthcare. Qualified
|
|
327
|
+
withdrawals are not taxed.
|
|
328
|
+
|
|
329
|
+
Do not use "pre-tax" or "post-tax" as account names; they blur the line between
|
|
330
|
+
tax-deferred and taxable.
|
|
331
|
+
|
|
332
|
+
## Core FIRE / decumulation concepts
|
|
333
|
+
|
|
334
|
+
- **Safe Withdrawal Rate (SWR)**: the share of the portfolio taken out in the
|
|
335
|
+
first year of drawdown. The classic "4% rule" (Trinity study) is a starting
|
|
336
|
+
heuristic for a 30-year horizon, not a guarantee; a longer horizon argues for
|
|
337
|
+
a lower start. The portfolio withdrawal a plan needs falls as guaranteed
|
|
338
|
+
income (Social Security, pension) switches on.
|
|
339
|
+
- **Sequence-of-returns risk**: poor returns in the first years of drawdown do
|
|
340
|
+
far more damage than the same returns later. Common mitigations: a cash/bond
|
|
341
|
+
bridge, and a **rising-equity glidepath** ("bond tent" - most bonds at
|
|
342
|
+
retirement, equity rising after).
|
|
343
|
+
- **Asset location**: which account holds which asset. A common convention
|
|
344
|
+
places bonds in tax-deferred accounts, high-growth equity in tax-free (Roth,
|
|
345
|
+
HSA) accounts, and tax-efficient equity and cash in taxable. Location changes
|
|
346
|
+
after-tax return without changing the overall allocation.
|
|
347
|
+
- **Roth conversion**: moving money from a tax-deferred account into a tax-free
|
|
348
|
+
one. The converted amount is taxed as ordinary income in the year of the
|
|
349
|
+
conversion. A "Roth conversion ladder" converts in low-income years (often
|
|
350
|
+
the window after work ends and before Social Security or RMDs start) to fill
|
|
351
|
+
a low bracket, lower later RMDs, and shrink the taxable estate. Paying that
|
|
352
|
+
year's tax from a taxable account rather than from withholding keeps more
|
|
353
|
+
money inside the tax-free account.
|
|
354
|
+
|
|
355
|
+
## Tax concepts that gate conversions
|
|
356
|
+
|
|
357
|
+
Only the shape of each rule is here. ProjectionLab computes with the
|
|
358
|
+
current-year figures, and the user reads them in Tax Analytics. MAGI means
|
|
359
|
+
modified adjusted gross income; each program (ACA, IRMAA, NIIT) defines it
|
|
360
|
+
slightly differently.
|
|
361
|
+
|
|
362
|
+
- **Federal income tax brackets**: ordinary income is taxed in bands. Income
|
|
363
|
+
that fills an unused low band is cheap; income pushed into the next band
|
|
364
|
+
costs more. What a conversion costs depends on where it lands.
|
|
365
|
+
- **ACA premium subsidies**: marketplace health coverage is income-tested. In
|
|
366
|
+
some income ranges extra income can cut a subsidy faster than tax does, so
|
|
367
|
+
the effective marginal rate in those pre-Medicare years is higher than the
|
|
368
|
+
bracket alone suggests. Not a factor with employer, retiree or other
|
|
369
|
+
non-marketplace coverage.
|
|
370
|
+
- **IRMAA**: an extra charge on Medicare Part B and Part D premiums. It is set
|
|
371
|
+
by the person's MAGI from two years earlier and comes in tiers, so income
|
|
372
|
+
just over a tier boundary pays the whole higher charge. A conversion in one
|
|
373
|
+
year can raise premiums two years later. If the user is already on Medicare
|
|
374
|
+
when the plan starts, ProjectionLab estimates that lookback income in the
|
|
375
|
+
first two plan years, and the actual rule applies from year 3
|
|
376
|
+
(https://projectionlab.com/help/modeling-irmaa-surcharges).
|
|
377
|
+
- **NIIT (net investment income tax)**: a surtax on investment income (gains,
|
|
378
|
+
dividends, interest, rent) once MAGI is above an income threshold. It raises
|
|
379
|
+
the cost of a year that mixes a conversion with investment income.
|
|
380
|
+
- **Long-term capital gains rate**: while taxable income stays under a
|
|
381
|
+
threshold, long-term gains are taxed at 0%. A low-income year can realize
|
|
382
|
+
some gains at no tax cost before that room is gone.
|
|
383
|
+
- **RMDs (Required Minimum Distributions)**: once a person reaches the RMD age,
|
|
384
|
+
tax-deferred accounts require a withdrawal every year, whether or not the
|
|
385
|
+
cash is needed. A large tax-deferred balance can push those forced
|
|
386
|
+
withdrawals into higher brackets and IRMAA tiers, which is the usual reason
|
|
387
|
+
people convert while their income is still low.
|
|
388
|
+
|
|
389
|
+
## Analysis checklist
|
|
390
|
+
|
|
391
|
+
1. Build a lifecycle timeline (phase, date range, milestone trigger).
|
|
392
|
+
2. Cash flow by phase; flag pure-drawdown years and the gap before Social
|
|
393
|
+
Security starts.
|
|
394
|
+
3. Withdrawal rate now and after guaranteed income begins.
|
|
395
|
+
4. Sequence risk: what a poor-return start does to the plan. Only a run in the
|
|
396
|
+
ProjectionLab UI can show it.
|
|
397
|
+
5. Roth conversion efficiency: bracket headroom versus the ACA, IRMAA and NIIT
|
|
398
|
+
ceilings; compare lifetime taxes and net legacy, not just the tax now.
|
|
399
|
+
6. Longevity: does the plan last well past life expectancy?
|
|
400
|
+
7. Inflation: healthcare and long-term care costs rise with inflation and are
|
|
401
|
+
often decades out; check how the plan assumes them.
|
|
402
|
+
|
|
403
|
+
## ProjectionLab help articles
|
|
404
|
+
|
|
405
|
+
ProjectionLab's own pages, linked for the user and summarized here for a model
|
|
406
|
+
with no web access. The bracketed tag is the plan section or area this reference
|
|
407
|
+
uses for it. The summaries are ours, not ProjectionLab's wording. Glossary of
|
|
408
|
+
financial terms: https://projectionlab.com/financial-terms
|
|
409
|
+
|
|
410
|
+
- **Withdrawal Strategy mode** [withdrawalStrategy]
|
|
411
|
+
https://projectionlab.com/help/withdrawal-strategy-mode - a comparison mode
|
|
412
|
+
for classic rules (initial percentage, variable percentage withdrawal,
|
|
413
|
+
Guyton-Klinger) that starts at a chosen year or milestone. While it is on,
|
|
414
|
+
its rule replaces most other plan events, so most plans leave it off.
|
|
415
|
+
- **Flows, the cash flow priorities** [priorities]
|
|
416
|
+
https://projectionlab.com/help/cash-flow-priorities - Flows (the
|
|
417
|
+
\`priorities\` section in the data) send income to savings goals,
|
|
418
|
+
contributions, extra debt payments and transfers, earliest-added first.
|
|
419
|
+
- **Mandatory goals ("Always Fund")** [priorities]
|
|
420
|
+
https://projectionlab.com/help/mandatory-goals - an Always Fund flow is paid
|
|
421
|
+
ahead of the other flows, selling from other accounts when income falls short.
|
|
422
|
+
- **Milestones** [milestones]
|
|
423
|
+
https://projectionlab.com/help/manage-milestones - lifecycle markers
|
|
424
|
+
triggered by age, date, balance, or a combination of criteria; other events
|
|
425
|
+
anchor their start and end to them. Retirement and Life Expectancy cannot be
|
|
426
|
+
deleted.
|
|
427
|
+
- **Drawdown order** [variables; the chart is app only]
|
|
428
|
+
https://projectionlab.com/help/drawdown-order-visualization - the order
|
|
429
|
+
accounts are liquidated in to cover a yearly shortfall. The graph and its red
|
|
430
|
+
early-withdrawal penalty line are a UI view of that order.
|
|
431
|
+
- **Roth conversions** [accounts; the optimizer is app only]
|
|
432
|
+
https://projectionlab.com/help/roth-conversion - Optimize searches conversion
|
|
433
|
+
strategies against brackets, IRMAA and legacy goals with a beam search, then
|
|
434
|
+
writes the chosen schedule into the plan's accounts. This server can read and
|
|
435
|
+
edit such a schedule; it cannot run the search.
|
|
436
|
+
- **Bond allocation and location** [accounts, variables]
|
|
437
|
+
https://projectionlab.com/help/bond-allocation-and-overrides - the bond
|
|
438
|
+
percentage is set plan-wide and can be overridden per account, and the other
|
|
439
|
+
accounts adjust to keep the plan-wide target, with a warning when it cannot
|
|
440
|
+
balance. Bond location chooses which accounts hold bonds first.
|
|
441
|
+
- **Custom growth and dividend rates** [accounts]
|
|
442
|
+
https://projectionlab.com/help/growth-dividend-settings-chance-of-success - an
|
|
443
|
+
account's custom growth or dividend rate covers its stock portion; the bond
|
|
444
|
+
portion follows the plan's bond settings unless the account's bond allocation
|
|
445
|
+
is overridden to 0%. In Chance of Success such a rate is either held fixed or
|
|
446
|
+
sampled like the rest of the simulation.
|
|
447
|
+
- **IRMAA surcharges** [variables; the optimizer is app only]
|
|
448
|
+
https://projectionlab.com/help/modeling-irmaa-surcharges - tiered Medicare
|
|
449
|
+
Part B and Part D surcharges set by MAGI two years earlier, where crossing a
|
|
450
|
+
tier by any amount costs the whole surcharge. When the user is already on
|
|
451
|
+
Medicare at plan start, ProjectionLab estimates the lookback income for the
|
|
452
|
+
first two plan years.
|
|
453
|
+
- **Plan vs Chance of Success** [montecarlo; results are app only]
|
|
454
|
+
https://projectionlab.com/help/plan-vs-chance-of-success - the Plan tab is one
|
|
455
|
+
fixed path at fixed growth; Chance of Success runs many trials over historical
|
|
456
|
+
or randomized market data. All other tabs follow the Plan tab, not the trial
|
|
457
|
+
outcomes.
|
|
458
|
+
- **Simulation engine** [app only]
|
|
459
|
+
https://projectionlab.com/help/simulation-engine - the app simulates a full
|
|
460
|
+
year at a time (income, withholding, expenses, debt, dividends, prior-year
|
|
461
|
+
taxes, RMDs) and turns a surplus into savings and a shortfall into
|
|
462
|
+
withdrawals.
|
|
463
|
+
- **Flexible spending** [expenses; the feature is app only]
|
|
464
|
+
https://projectionlab.com/help/flex-spending - an optional rule that raises
|
|
465
|
+
or cuts spending with portfolio performance against earlier all-time highs,
|
|
466
|
+
scoped either to all spending or to discretionary expenses only.
|
|
467
|
+
- **Plugins and external accounts** [Current Finances; app only]
|
|
468
|
+
https://projectionlab.com/help/plugins - ProjectionLab does not link to banks;
|
|
469
|
+
plugins (Lunch Money, YNAB, Monarch, or your own code) write balances into
|
|
470
|
+
Current Finances through the Plugin API, which has to be enabled in account
|
|
471
|
+
settings. This server uses that same API.
|
|
472
|
+
`;
|
|
473
|
+
export function renderKnowledgeMarkdown(layout = "v4") {
|
|
474
|
+
return layout === "v5" ? KNOWLEDGE_V5 : KNOWLEDGE_V4;
|
|
475
|
+
}
|
|
476
|
+
export function registerKnowledgeResource(server, bridge) {
|
|
477
|
+
registerLayoutResource(server, bridge, {
|
|
478
|
+
name: "knowledge",
|
|
479
|
+
uri: "projectionlab://knowledge",
|
|
226
480
|
title: "ProjectionLab & FIRE Knowledge",
|
|
227
481
|
description: "Curated reference: ProjectionLab data model, FIRE/decumulation concepts, " +
|
|
228
482
|
"retirement tax concepts without yearly figures, an analysis checklist, and an " +
|
|
229
|
-
"index of ProjectionLab help articles
|
|
483
|
+
"index of ProjectionLab help articles, for the connected ProjectionLab version once a " +
|
|
484
|
+
"connection check has run (ProjectionLab 4 before that; append ?layout=v4 or ?layout=v5 " +
|
|
485
|
+
"to choose). Information and education, not " +
|
|
230
486
|
"personalized financial advice.",
|
|
231
|
-
|
|
232
|
-
}
|
|
233
|
-
contents: [
|
|
234
|
-
{
|
|
235
|
-
uri: uri.href,
|
|
236
|
-
text: KNOWLEDGE,
|
|
237
|
-
mimeType: "text/markdown",
|
|
238
|
-
},
|
|
239
|
-
],
|
|
240
|
-
}));
|
|
487
|
+
render: renderKnowledgeMarkdown,
|
|
488
|
+
});
|
|
241
489
|
}
|
|
242
490
|
//# sourceMappingURL=knowledge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knowledge.js","sourceRoot":"","sources":["../../src/resources/knowledge.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"knowledge.js","sourceRoot":"","sources":["../../src/resources/knowledge.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqO3B,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,YAAY,CAAC;AAEtC,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+O3B,CAAC;AAEF,MAAM,UAAU,uBAAuB,CAAC,SAAuB,IAAI;IACjE,OAAO,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,MAAiB,EAAE,MAAe;IAC1E,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE;QACrC,IAAI,EAAE,WAAW;QACjB,GAAG,EAAE,2BAA2B;QAChC,KAAK,EAAE,gCAAgC;QACvC,WAAW,EACT,2EAA2E;YAC3E,gFAAgF;YAChF,uFAAuF;YACvF,yFAAyF;YACzF,6CAA6C;YAC7C,gCAAgC;QAClC,MAAM,EAAE,uBAAuB;KAChC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import type { Bridge } from "../bridge.js";
|
|
3
|
+
import { type ExportLayout } from "../layout.js";
|
|
4
|
+
export interface LayoutResourceSpec {
|
|
5
|
+
name: string;
|
|
6
|
+
uri: string;
|
|
7
|
+
title: string;
|
|
8
|
+
description: string;
|
|
9
|
+
render: (layout: ExportLayout) => string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Registers a markdown resource whose text follows the ProjectionLab layout.
|
|
13
|
+
*
|
|
14
|
+
* The plain URI is a fixed resource, so it is listed and read by exact match.
|
|
15
|
+
* `<uri>?layout=v4` and `<uri>?layout=v5` are served by a URI template beside
|
|
16
|
+
* it, because the SDK reads a fixed resource only when the requested URI
|
|
17
|
+
* matches it exactly, query string included.
|
|
18
|
+
*/
|
|
19
|
+
export declare function registerLayoutResource(server: McpServer, bridge: Bridge | undefined, spec: LayoutResourceSpec): void;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ResourceTemplate, } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { layoutForContract } from "../layout.js";
|
|
3
|
+
/**
|
|
4
|
+
* Registers a markdown resource whose text follows the ProjectionLab layout.
|
|
5
|
+
*
|
|
6
|
+
* The plain URI is a fixed resource, so it is listed and read by exact match.
|
|
7
|
+
* `<uri>?layout=v4` and `<uri>?layout=v5` are served by a URI template beside
|
|
8
|
+
* it, because the SDK reads a fixed resource only when the requested URI
|
|
9
|
+
* matches it exactly, query string included.
|
|
10
|
+
*/
|
|
11
|
+
export function registerLayoutResource(server, bridge, spec) {
|
|
12
|
+
const metadata = {
|
|
13
|
+
title: spec.title,
|
|
14
|
+
description: spec.description,
|
|
15
|
+
mimeType: "text/markdown",
|
|
16
|
+
};
|
|
17
|
+
const read = async (uri) => {
|
|
18
|
+
let layout;
|
|
19
|
+
const param = uri.searchParams.get("layout");
|
|
20
|
+
if (param === "v5" || param === "v4") {
|
|
21
|
+
layout = param;
|
|
22
|
+
}
|
|
23
|
+
else if (bridge) {
|
|
24
|
+
// The contract the last connection check or write read; reading a
|
|
25
|
+
// resource never waits on the browser.
|
|
26
|
+
const contract = bridge.knownApiContract();
|
|
27
|
+
if (contract !== undefined)
|
|
28
|
+
layout = layoutForContract(contract);
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
contents: [
|
|
32
|
+
{
|
|
33
|
+
uri: uri.href,
|
|
34
|
+
text: spec.render(layout ?? "v4"),
|
|
35
|
+
mimeType: "text/markdown",
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
server.registerResource(spec.name, spec.uri, metadata, read);
|
|
41
|
+
server.registerResource(`${spec.name}-layout`, new ResourceTemplate(`${spec.uri}{?layout}`, { list: undefined }), metadata, read);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=layoutResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layoutResource.js","sourceRoot":"","sources":["../../src/resources/layoutResource.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,GAEjB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EAAE,iBAAiB,EAAqB,MAAM,cAAc,CAAC;AAUpE;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CACpC,MAAiB,EACjB,MAA0B,EAC1B,IAAwB;IAExB,MAAM,QAAQ,GAAG;QACf,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,QAAQ,EAAE,eAAe;KAC1B,CAAC;IACF,MAAM,IAAI,GAAG,KAAK,EAAE,GAAQ,EAAE,EAAE;QAC9B,IAAI,MAAgC,CAAC;QACrC,MAAM,KAAK,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC7C,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACrC,MAAM,GAAG,KAAK,CAAC;QACjB,CAAC;aAAM,IAAI,MAAM,EAAE,CAAC;YAClB,kEAAkE;YAClE,uCAAuC;YACvC,MAAM,QAAQ,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;YAC3C,IAAI,QAAQ,KAAK,SAAS;gBAAE,MAAM,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;QACnE,CAAC;QACD,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,GAAG,EAAE,GAAG,CAAC,IAAI;oBACb,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC;oBACjC,QAAQ,EAAE,eAAe;iBAC1B;aACF;SACF,CAAC;IACJ,CAAC,CAAC;IAEF,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC7D,MAAM,CAAC,gBAAgB,CACrB,GAAG,IAAI,CAAC,IAAI,SAAS,EACrB,IAAI,gBAAgB,CAAC,GAAG,IAAI,CAAC,GAAG,WAAW,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EACjE,QAAQ,EACR,IAAI,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { log } from "../logger.js";
|
|
|
4
4
|
export function registerPlanDataResource(server, bridge) {
|
|
5
5
|
server.registerResource("plan-data", "projectionlab://plan-data", {
|
|
6
6
|
title: "ProjectionLab Plan Data",
|
|
7
|
-
description: "Full export of all ProjectionLab data (plans, finances, progress,
|
|
7
|
+
description: "Full export of all ProjectionLab data (plans, current finances, settings, and progress or account history, in the layout of the connected ProjectionLab version). Refreshed on each access.",
|
|
8
8
|
mimeType: "application/json",
|
|
9
9
|
}, async (uri) => {
|
|
10
10
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planData.js","sourceRoot":"","sources":["../../src/resources/planData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGpC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,MAAM,UAAU,wBAAwB,CACtC,MAAiB,EACjB,MAAc;IAEd,MAAM,CAAC,gBAAgB,CACrB,WAAW,EACX,2BAA2B,EAC3B;QACE,KAAK,EAAE,yBAAyB;QAChC,WAAW,EACT,
|
|
1
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BACF;aACF,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/snapshot.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Snapshot } from "./types/projectionlab.js";
|
|
2
|
+
import type { ExportLayout } from "./layout.js";
|
|
2
3
|
/** The three mutually exclusive ways a caller can name one snapshot. */
|
|
3
4
|
export interface SnapshotSelectorArgs {
|
|
4
5
|
snapshotId?: string | null;
|
|
@@ -10,7 +11,7 @@ export declare class SnapshotManager {
|
|
|
10
11
|
private initialized;
|
|
11
12
|
private ensureDir;
|
|
12
13
|
private prune;
|
|
13
|
-
create(operation: string, sections: string[], data: Record<string, unknown
|
|
14
|
+
create(operation: string, sections: string[], data: Record<string, unknown>, layout: ExportLayout): Promise<Snapshot>;
|
|
14
15
|
list(): Promise<Omit<Snapshot, "data">[]>;
|
|
15
16
|
get(snapshotId: string): Promise<Snapshot>;
|
|
16
17
|
}
|
package/dist/snapshot.js
CHANGED
|
@@ -80,13 +80,14 @@ export class SnapshotManager {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
async create(operation, sections, data) {
|
|
83
|
+
async create(operation, sections, data, layout) {
|
|
84
84
|
await this.ensureDir();
|
|
85
85
|
const snapshot = {
|
|
86
86
|
id: randomUUID(),
|
|
87
87
|
timestamp: new Date().toISOString(),
|
|
88
88
|
operation,
|
|
89
89
|
sections,
|
|
90
|
+
layout,
|
|
90
91
|
// The Plugin API key is stored as SNAPSHOT_KEY_PLACEHOLDER, so the file
|
|
91
92
|
// on disk never holds it; SnapshotManager.get puts the current
|
|
92
93
|
// config.apiKey back on every read, which keeps a rollback exact while
|
|
@@ -115,6 +116,7 @@ export class SnapshotManager {
|
|
|
115
116
|
timestamp: snap.timestamp,
|
|
116
117
|
operation: snap.operation,
|
|
117
118
|
sections: snap.sections,
|
|
119
|
+
layout: snap.layout,
|
|
118
120
|
});
|
|
119
121
|
}
|
|
120
122
|
catch {
|
package/dist/snapshot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../src/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../src/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAIlC,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,OAAO,GACX,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C,wBAAwB,QAAQ,CAAC,KAAK,mBAAmB,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,EAC9F,yFAAyF,CAC1F,CAAC;YACJ,CAAC;YAED,OAAO,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/summary.d.ts
CHANGED
|
@@ -1,7 +1,44 @@
|
|
|
1
|
+
import { type PlanObj } from "./plans.js";
|
|
1
2
|
import type { ExportedData, FinancialSummary } from "./types/projectionlab.js";
|
|
3
|
+
type Totals = Record<string, {
|
|
4
|
+
count: number;
|
|
5
|
+
total: number;
|
|
6
|
+
}>;
|
|
7
|
+
/** A person of a ProjectionLab 5 household, from `household.people`. */
|
|
8
|
+
export interface HouseholdPerson {
|
|
9
|
+
/** The `household.people` key: "me" or "spouse". */
|
|
10
|
+
role: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
birthYear?: number;
|
|
13
|
+
birthMonth?: number;
|
|
14
|
+
lifeExpectancy?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* What a ProjectionLab 5 export adds to the summary. A ProjectionLab 4 summary
|
|
18
|
+
* carries none of these fields.
|
|
19
|
+
*/
|
|
20
|
+
export interface V5SummaryDetails {
|
|
21
|
+
layout: "v5";
|
|
22
|
+
/** Unarchived accounts grouped by `kind`; debt totals are magnitudes. */
|
|
23
|
+
accountsByKind: Totals;
|
|
24
|
+
/** Unarchived real assets with the equity left after their secured debts. */
|
|
25
|
+
realAssets: PlanObj[];
|
|
26
|
+
/** Archived accounts, left out of every total. */
|
|
27
|
+
archivedAccounts: PlanObj[];
|
|
28
|
+
/** Unarchived accounts of a `kind` this server does not recognize, left out of every total. */
|
|
29
|
+
unrecognizedAccounts: PlanObj[];
|
|
30
|
+
household?: {
|
|
31
|
+
partnerStatus?: string;
|
|
32
|
+
people: HouseholdPerson[];
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export type CurrentFinancesSummary = FinancialSummary & Partial<V5SummaryDetails>;
|
|
2
36
|
/**
|
|
3
37
|
* Current Finances totals and the plan inventory, shared by the
|
|
4
38
|
* projectionlab_get_summary tool and the projectionlab://summary resource.
|
|
5
|
-
* Totals come from today's balances, never from projected outcomes.
|
|
39
|
+
* Totals come from today's balances, never from projected outcomes. Reads
|
|
40
|
+
* either export layout; a ProjectionLab 4 summary is unchanged by the v5
|
|
41
|
+
* support.
|
|
6
42
|
*/
|
|
7
|
-
export declare function buildSummary(data: ExportedData):
|
|
43
|
+
export declare function buildSummary(data: ExportedData): CurrentFinancesSummary;
|
|
44
|
+
export {};
|