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
package/dist/plans.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plans.js","sourceRoot":"","sources":["../src/plans.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAIjD,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,QAAQ;IACR,UAAU;IACV,UAAU;IACV,QAAQ;IACR,YAAY;IACZ,WAAW;IACX,oBAAoB;IACpB,YAAY;IACZ,YAAY;CACJ,CAAC;AAIX;4EAC4E;AAC5E,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,QAAQ;IACR,UAAU;IACV,UAAU;IACV,QAAQ;IACR,YAAY;IACZ,YAAY;CACJ,CAAC;AAEX;;;;qEAIqE;AACrE,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,QAAQ;IAClB,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,OAAO;IACnB,SAAS,EAAE,QAAQ;IACnB,kBAAkB,EAAE,QAAQ;IAC5B,UAA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ACnC,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QACnC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACZ,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,IAAI,UAAU,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;QAC3D,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/realEstate.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PlanObj } from "./plans.js";
|
|
2
|
+
import { type V5AccountEntry } from "./currentFinances.js";
|
|
2
3
|
/**
|
|
3
4
|
* Labeled view of a property asset, or null for non-real-estate records.
|
|
4
5
|
*
|
|
@@ -20,3 +21,22 @@ export declare function buildRealEstateBlock(asset: PlanObj): PlanObj | null;
|
|
|
20
21
|
* qualifies.
|
|
21
22
|
*/
|
|
22
23
|
export declare function withRealEstateBlocks(today: PlanObj): PlanObj;
|
|
24
|
+
/**
|
|
25
|
+
* Labeled view of a ProjectionLab 5 real asset, or null for any other record.
|
|
26
|
+
*
|
|
27
|
+
* A v5 real asset stores its worth in `value` and its loans as separate debt
|
|
28
|
+
* accounts that name it in `securedByAssetId`. The block gathers the asset's
|
|
29
|
+
* unarchived secured debts and states `equity` as `value` minus their
|
|
30
|
+
* balances: arithmetic on stored fields, not ProjectionLab's own net-worth
|
|
31
|
+
* figure. A debt with no `securedByAssetId` is tied to no asset.
|
|
32
|
+
*
|
|
33
|
+
* `entries` is the whole account list of one Current Finances read.
|
|
34
|
+
*/
|
|
35
|
+
export declare function buildRealAssetBlock(asset: V5AccountEntry, entries: readonly V5AccountEntry[]): PlanObj | null;
|
|
36
|
+
/**
|
|
37
|
+
* Copy of a v5 Current Finances document with a `realAsset` block added to
|
|
38
|
+
* each real-asset account. The export comes from a shared cache, so records
|
|
39
|
+
* are only replaced, never mutated in place; the original object is returned
|
|
40
|
+
* unchanged when no real asset qualifies.
|
|
41
|
+
*/
|
|
42
|
+
export declare function withRealAssetBlocks(finances: PlanObj): PlanObj;
|
package/dist/realEstate.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { finiteNumber, listV5Accounts, } from "./currentFinances.js";
|
|
1
2
|
/**
|
|
2
3
|
* `type` value that marks a Current Finances `assets` entry as a property.
|
|
3
4
|
* Observed in live exports; the ProjectionLab UI shows these records on the
|
|
@@ -115,4 +116,60 @@ export function withRealEstateBlocks(today) {
|
|
|
115
116
|
});
|
|
116
117
|
return changed ? { ...today, assets: nextAssets } : today;
|
|
117
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Labeled view of a ProjectionLab 5 real asset, or null for any other record.
|
|
121
|
+
*
|
|
122
|
+
* A v5 real asset stores its worth in `value` and its loans as separate debt
|
|
123
|
+
* accounts that name it in `securedByAssetId`. The block gathers the asset's
|
|
124
|
+
* unarchived secured debts and states `equity` as `value` minus their
|
|
125
|
+
* balances: arithmetic on stored fields, not ProjectionLab's own net-worth
|
|
126
|
+
* figure. A debt with no `securedByAssetId` is tied to no asset.
|
|
127
|
+
*
|
|
128
|
+
* `entries` is the whole account list of one Current Finances read.
|
|
129
|
+
*/
|
|
130
|
+
export function buildRealAssetBlock(asset, entries) {
|
|
131
|
+
if (asset.kind !== "real-asset")
|
|
132
|
+
return null;
|
|
133
|
+
const value = finiteNumber(asset.account.value);
|
|
134
|
+
const securedDebts = entries
|
|
135
|
+
.filter((entry) => entry.kind === "debt" &&
|
|
136
|
+
!entry.archived &&
|
|
137
|
+
(entry.account.securedByAssetId === asset.id ||
|
|
138
|
+
entry.account.securedByAssetId === asset.key))
|
|
139
|
+
.map((entry) => ({
|
|
140
|
+
id: entry.id,
|
|
141
|
+
name: entry.name,
|
|
142
|
+
balance: Math.abs(finiteNumber(entry.account.balance)),
|
|
143
|
+
}));
|
|
144
|
+
const loanBalance = securedDebts.reduce((sum, debt) => sum + debt.balance, 0);
|
|
145
|
+
const block = { value };
|
|
146
|
+
if (asset.account.purchasePrice !== undefined) {
|
|
147
|
+
block.purchasePrice = finiteNumber(asset.account.purchasePrice);
|
|
148
|
+
}
|
|
149
|
+
block.loanBalance = loanBalance;
|
|
150
|
+
block.equity = value - loanBalance;
|
|
151
|
+
block.securedDebts = securedDebts;
|
|
152
|
+
return block;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Copy of a v5 Current Finances document with a `realAsset` block added to
|
|
156
|
+
* each real-asset account. The export comes from a shared cache, so records
|
|
157
|
+
* are only replaced, never mutated in place; the original object is returned
|
|
158
|
+
* unchanged when no real asset qualifies.
|
|
159
|
+
*/
|
|
160
|
+
export function withRealAssetBlocks(finances) {
|
|
161
|
+
const entries = listV5Accounts(finances);
|
|
162
|
+
const accounts = finances.accounts;
|
|
163
|
+
if (!accounts)
|
|
164
|
+
return finances;
|
|
165
|
+
let nextAccounts;
|
|
166
|
+
for (const entry of entries) {
|
|
167
|
+
const block = buildRealAssetBlock(entry, entries);
|
|
168
|
+
if (!block)
|
|
169
|
+
continue;
|
|
170
|
+
nextAccounts ??= { ...accounts };
|
|
171
|
+
nextAccounts[entry.key] = { ...entry.account, realAsset: block };
|
|
172
|
+
}
|
|
173
|
+
return nextAccounts ? { ...finances, accounts: nextAccounts } : finances;
|
|
174
|
+
}
|
|
118
175
|
//# sourceMappingURL=realEstate.js.map
|
package/dist/realEstate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realEstate.js","sourceRoot":"","sources":["../src/realEstate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"realEstate.js","sourceRoot":"","sources":["../src/realEstate.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,cAAc,GAEf,MAAM,sBAAsB,CAAC;AAE9B;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC;;;GAGG;AACH,MAAM,QAAQ,GAAG,UAAU,CAAC;AAE5B,SAAS,IA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AAa,GAAG,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAClE,CAAC;IACD,KAAK,CAAC,WAAW,GAAG,WAAW,CAAC;IAChC,KAAK,CAAC,MAAM,GAAG,KAAK,GAAG,WAAW,CAAC;IACnC,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC;IAClC,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAiB;IACnD,MAAM,OAAO,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAA+B,CAAC;IAC1D,IAAI,CAAC,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC/B,IAAI,YAAiC,CAAC;IACtC,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,KAAK,GAAG,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK;YAAE,SAAS;QACrB,YAAY,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;QACjC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IACnE,CAAC;IACD,OAAO,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC3E,CAAC"}
|
package/dist/redact.d.ts
CHANGED
|
@@ -42,3 +42,23 @@ export interface RedactOptions {
|
|
|
42
42
|
* Never mutates the input.
|
|
43
43
|
*/
|
|
44
44
|
export declare function redactSecrets<T>(value: T, opts?: RedactOptions): T;
|
|
45
|
+
/** What keepStoredSecrets did with a payload's secret-named fields. */
|
|
46
|
+
export interface StoredSecrets<T> {
|
|
47
|
+
/** The payload with each hidden secret replaced by its stored value. */
|
|
48
|
+
value: T;
|
|
49
|
+
/** Dot paths of the hidden secrets filled from the stored document. */
|
|
50
|
+
kept: string[];
|
|
51
|
+
/** Dot paths of hidden secrets the stored document has no value for. */
|
|
52
|
+
unfilled: string[];
|
|
53
|
+
/** Dot paths of stored secrets the payload leaves out. */
|
|
54
|
+
dropped: string[];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Lets a payload built from a redacted read write the stored secrets back
|
|
58
|
+
* unchanged. Each secret-named field holding the REDACTED sentinel takes the
|
|
59
|
+
* string at the same path in `stored`, the document as ProjectionLab holds
|
|
60
|
+
* it now, so the secret never passes through the caller. Also lists the
|
|
61
|
+
* stored secrets the payload leaves out, which a whole-document replace
|
|
62
|
+
* would erase. Never mutates either input.
|
|
63
|
+
*/
|
|
64
|
+
export declare function keepStoredSecrets<T>(payload: T, stored: unknown): StoredSecrets<T>;
|
package/dist/redact.js
CHANGED
|
@@ -131,4 +131,66 @@ export function redactSecrets(value, opts = {}) {
|
|
|
131
131
|
};
|
|
132
132
|
return walk(value);
|
|
133
133
|
}
|
|
134
|
+
const isRecord = (v) => !!v && typeof v === "object" && !Array.isArray(v);
|
|
135
|
+
/**
|
|
136
|
+
* Lets a payload built from a redacted read write the stored secrets back
|
|
137
|
+
* unchanged. Each secret-named field holding the REDACTED sentinel takes the
|
|
138
|
+
* string at the same path in `stored`, the document as ProjectionLab holds
|
|
139
|
+
* it now, so the secret never passes through the caller. Also lists the
|
|
140
|
+
* stored secrets the payload leaves out, which a whole-document replace
|
|
141
|
+
* would erase. Never mutates either input.
|
|
142
|
+
*/
|
|
143
|
+
export function keepStoredSecrets(payload, stored) {
|
|
144
|
+
const kept = [];
|
|
145
|
+
const unfilled = [];
|
|
146
|
+
const dropped = [];
|
|
147
|
+
const fill = (v, from, at) => {
|
|
148
|
+
if (Array.isArray(v)) {
|
|
149
|
+
return v.map((item, i) => fill(item, Array.isArray(from) ? from[i] : undefined, at ? `${at}.${i}` : String(i)));
|
|
150
|
+
}
|
|
151
|
+
if (!isRecord(v))
|
|
152
|
+
return v;
|
|
153
|
+
const source = isRecord(from) ? from : {};
|
|
154
|
+
const out = {};
|
|
155
|
+
for (const [k, val] of Object.entries(v)) {
|
|
156
|
+
const path = at ? `${at}.${k}` : k;
|
|
157
|
+
if (isSecretFieldName(k) && val === REDACTED) {
|
|
158
|
+
const storedValue = source[k];
|
|
159
|
+
if (typeof storedValue === "string" && storedValue !== REDACTED) {
|
|
160
|
+
out[k] = storedValue;
|
|
161
|
+
kept.push(path);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
out[k] = val;
|
|
165
|
+
unfilled.push(path);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
out[k] = fill(val, source[k], path);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return out;
|
|
173
|
+
};
|
|
174
|
+
const missing = (from, v, at) => {
|
|
175
|
+
if (Array.isArray(from)) {
|
|
176
|
+
from.forEach((item, i) => missing(item, Array.isArray(v) ? v[i] : undefined, at ? `${at}.${i}` : String(i)));
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
if (!isRecord(from))
|
|
180
|
+
return;
|
|
181
|
+
const target = isRecord(v) ? v : undefined;
|
|
182
|
+
for (const [k, val] of Object.entries(from)) {
|
|
183
|
+
const path = at ? `${at}.${k}` : k;
|
|
184
|
+
if (isSecretFieldName(k) && typeof val === "string" && val !== "") {
|
|
185
|
+
if (target === undefined || !(k in target))
|
|
186
|
+
dropped.push(path);
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
missing(val, target?.[k], path);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
missing(stored, payload, "");
|
|
194
|
+
return { value: fill(payload, stored, ""), kept, unfilled, dropped };
|
|
195
|
+
}
|
|
134
196
|
//# sourceMappingURL=redact.js.map
|
package/dist/redact.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":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@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import type { Bridge } from "../bridge.js";
|
|
3
|
+
import type { ExportLayout } from "../layout.js";
|
|
4
|
+
export declare function renderDataModelV4Markdown(): string;
|
|
5
|
+
export declare function renderDataModelV5Markdown(): string;
|
|
6
|
+
export declare function renderDataModelMarkdown(layout?: ExportLayout): string;
|
|
7
|
+
export declare function registerDataModelResource(server: McpServer, bridge?: Bridge): void;
|
|
@@ -1,18 +1,35 @@
|
|
|
1
|
-
import { DATA_MODEL_GROUPS, DATA_MODEL_PROJECTIONLAB_VERSION, } from "../dataModel.js";
|
|
1
|
+
import { DATA_MODEL_GROUPS, DATA_MODEL_PROJECTIONLAB_VERSION, DATA_MODEL_V5_GROUPS, DATA_MODEL_V5_PROJECTIONLAB_VERSION, enforcesAllowedValues, UI_LABELS_V5, } from "../dataModel.js";
|
|
2
|
+
import { registerLayoutResource } from "./layoutResource.js";
|
|
2
3
|
function renderField(pattern, field) {
|
|
3
4
|
const parts = [`- \`${pattern}\` [${field.evidence}]: ${field.description}`];
|
|
4
5
|
if (field.units)
|
|
5
6
|
parts.push(`Units: ${field.units}.`);
|
|
6
7
|
if (field.allowedValues) {
|
|
7
8
|
parts.push(`Allowed values: ${field.allowedValues.join(", ")}.`);
|
|
9
|
+
if (enforcesAllowedValues(field)) {
|
|
10
|
+
parts.push("A write of any other value is refused.");
|
|
11
|
+
}
|
|
8
12
|
}
|
|
9
13
|
if (field.enabledBy)
|
|
10
14
|
parts.push(`Enabled by: ${field.enabledBy}.`);
|
|
11
15
|
if (field.note)
|
|
12
16
|
parts.push(`Note: ${field.note}`);
|
|
17
|
+
if (field.uiLabel && field.uiLocation) {
|
|
18
|
+
parts.push(`In the app (ProjectionLab 5.0.0): "${field.uiLabel}" under ${field.uiLocation}.`);
|
|
19
|
+
}
|
|
13
20
|
return parts.join(" ");
|
|
14
21
|
}
|
|
15
|
-
|
|
22
|
+
/** Every field whose ProjectionLab 5.0.0 label is recorded. */
|
|
23
|
+
function renderUiLabels() {
|
|
24
|
+
const lines = [];
|
|
25
|
+
for (const [scope, labels] of Object.entries(UI_LABELS_V5)) {
|
|
26
|
+
for (const [path, [label, location]] of Object.entries(labels)) {
|
|
27
|
+
lines.push(`- \`${scope}.${path}\`: "${label}" under ${location}.`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return lines;
|
|
31
|
+
}
|
|
32
|
+
export function renderDataModelV4Markdown() {
|
|
16
33
|
const lines = [
|
|
17
34
|
`# ProjectionLab Data Model (ProjectionLab ${DATA_MODEL_PROJECTIONLAB_VERSION})`,
|
|
18
35
|
"",
|
|
@@ -46,21 +63,74 @@ export function renderDataModelMarkdown() {
|
|
|
46
63
|
}
|
|
47
64
|
return lines.join("\n");
|
|
48
65
|
}
|
|
49
|
-
export function
|
|
50
|
-
|
|
66
|
+
export function renderDataModelV5Markdown() {
|
|
67
|
+
const lines = [
|
|
68
|
+
`# ProjectionLab Data Model (ProjectionLab ${DATA_MODEL_V5_PROJECTIONLAB_VERSION})`,
|
|
69
|
+
"",
|
|
70
|
+
"Field reference for the values in ProjectionLab 5 exports. " +
|
|
71
|
+
"The root document envelope carries schema version 1 and an exportedAt timestamp, " +
|
|
72
|
+
"containing currentFinances, plans, settings, and accountHistory.",
|
|
73
|
+
"",
|
|
74
|
+
"Key characteristics of the ProjectionLab 5 layout:",
|
|
75
|
+
"- Accounts live in documents.currentFinances.accounts keyed by account ID. " +
|
|
76
|
+
"Each account record carries a kind discriminator: account (with balance and costBasis), " +
|
|
77
|
+
"debt (with balance and optional securedByAssetId), or real-asset (with value and purchasePrice). " +
|
|
78
|
+
"Archived accounts carry an archivedOn ISO date string.",
|
|
79
|
+
"- The Solo 401k, Roth Solo 401k, and SEP IRA account types store as type \"401k\" or \"roth-401k\" with subtype \"solo\", and type \"ira\" with subtype \"sep\".",
|
|
80
|
+
"- Plan events carry a kind discriminator: account, real-asset, income, expense, or priority. " +
|
|
81
|
+
"Plan account events link to Current Finances accounts via accountId, and asset events link via assetId. " +
|
|
82
|
+
"Event timing is defined by timing objects with type (date, milestone, keyword), value, and optional modifier.",
|
|
83
|
+
"- Plans carry no active flag. settings.plan.activeId and baselineId are reported as stored, and " +
|
|
84
|
+
"no plan is treated as the selected plan.",
|
|
85
|
+
"- A priority's accountId names the plan account event it routes cash to, not a Current Finances account. " +
|
|
86
|
+
"Event names need not be unique within a section; address an event by id when its name is ambiguous.",
|
|
87
|
+
"- Historical records are stored in documents.accountHistory keyed by account ID then calendar year, " +
|
|
88
|
+
"without a separate progress section.",
|
|
89
|
+
"",
|
|
90
|
+
"Evidence tags: [export-shape] means the field and its value type appear in a " +
|
|
91
|
+
"ProjectionLab 5 export; its meaning is not yet confirmed by a stored-value test. " +
|
|
92
|
+
"[observed] means a value was set through the ProjectionLab 5 UI and the stored value " +
|
|
93
|
+
"was read back. Writes are refused only on [observed] option lists.",
|
|
94
|
+
"",
|
|
95
|
+
];
|
|
96
|
+
for (const group of DATA_MODEL_V5_GROUPS) {
|
|
97
|
+
lines.push(`## ${group.title}`, "");
|
|
98
|
+
for (const [pattern, field] of Object.entries(group.fields)) {
|
|
99
|
+
lines.push(renderField(pattern, field));
|
|
100
|
+
}
|
|
101
|
+
lines.push("");
|
|
102
|
+
}
|
|
103
|
+
lines.push("## Fields in the app", "", "Plan settings (variables, montecarlo, withdrawalStrategy) and plan events keep the paths " +
|
|
104
|
+
"ProjectionLab 4 uses; their meanings, units and allowed values are in " +
|
|
105
|
+
"projectionlab://data-model?layout=v4. Each field below was found in the app by writing a " +
|
|
106
|
+
"distinct value to it or by matching a stored value to its control. Use the label and " +
|
|
107
|
+
"location when telling the user where to look. A location in parentheses names the mode " +
|
|
108
|
+
"or choice that must be selected for the control to appear.", "", ...renderUiLabels(), "", "## Fields the tools cannot change", "", "Do not write these, and do not try to reach them through another field. Tell the user " +
|
|
109
|
+
"where to change them in the app instead.", "", "- Milestone settings (Whose Milestone, Count Progress From, Start a Chapter, Active in " +
|
|
110
|
+
"This Plan, Marker on Charts, Warn if Never Reached) are not in the export.", "- Built-in milestones (retirement, life expectancy) have no `removable: true` and cannot " +
|
|
111
|
+
"be deleted.", "- Events ProjectionLab generates, such as the Medicare expenses, carry " +
|
|
112
|
+
'`_meta.deletion: "locked"`; leave them in place.', "- Derived figures are computed by the app and have no stored field: Monthly Benefit, " +
|
|
113
|
+
"Full Retirement Age, Years to Pay Off, Real Return, and a real asset's equity and loan " +
|
|
114
|
+
"balance.", "- Keys starting with an underscore (`_rothConversions`, `bondSettings._allocation`) are " +
|
|
115
|
+
"switched-off copies; editing them changes nothing in the app.", "- A field that only applies in a mode, such as `incomeRate` while `generateIncome` is " +
|
|
116
|
+
"off, has no effect until the user selects that mode.", "- A plan asset with an `assetId` shows its Details (Name, Owner, Purchase Price, Current " +
|
|
117
|
+
"Value, Type) from Current Finances, so those values change in every plan.", "- Progress history is recorded by ProjectionLab 5; writing it is refused.", "- Switching a Social Security income to Estimate Benefit in the app also changes its " +
|
|
118
|
+
"end and `taxExempt`; read the event again after the user switches modes.", "");
|
|
119
|
+
return lines.join("\n");
|
|
120
|
+
}
|
|
121
|
+
export function renderDataModelMarkdown(layout = "v4") {
|
|
122
|
+
return layout === "v5" ? renderDataModelV5Markdown() : renderDataModelV4Markdown();
|
|
123
|
+
}
|
|
124
|
+
export function registerDataModelResource(server, bridge) {
|
|
125
|
+
registerLayoutResource(server, bridge, {
|
|
126
|
+
name: "data-model",
|
|
127
|
+
uri: "projectionlab://data-model",
|
|
51
128
|
title: "ProjectionLab Data Model",
|
|
52
129
|
description: `Field meanings, units, and allowed values for path-addressable reads and writes, ` +
|
|
53
|
-
`version-stamped to ProjectionLab ${DATA_MODEL_PROJECTIONLAB_VERSION}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
{
|
|
59
|
-
uri: uri.href,
|
|
60
|
-
text: renderDataModelMarkdown(),
|
|
61
|
-
mimeType: "text/markdown",
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
}));
|
|
130
|
+
`version-stamped to ProjectionLab ${DATA_MODEL_PROJECTIONLAB_VERSION} (v4) and ` +
|
|
131
|
+
`${DATA_MODEL_V5_PROJECTIONLAB_VERSION} (v5). Follows the connected ProjectionLab version once a connection check has run, and ProjectionLab 4 before that; append ?layout=v4 or ?layout=v5 to choose. ` +
|
|
132
|
+
"Entries tagged ui-label or export-shape are not yet confirmed by a stored-value test.",
|
|
133
|
+
render: renderDataModelMarkdown,
|
|
134
|
+
});
|
|
65
135
|
}
|
|
66
136
|
//# sourceMappingURL=dataModel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataModel.js","sourceRoot":"","sources":["../../src/resources/dataModel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dataModel.js","sourceRoot":"","sources":["../../src/resources/dataModel.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,iBAAiB,EACjB,gCAAgC,EAChC,oBAAoB,EACpB,mCAAmC,EAEnC,qBAAqB,EACrB,YAAY,GACb,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,SAAS,WAAW,CAAC,OAAe,EAAE,KAAqB;IACzD,MAAM,KAAK,GAAG,CAAC,OAAO,OAAO,OAAO,KAAK,CAAC,QAAQ,MAAM,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;IAC7E,IAAI,KAAK,CAAC,KAAK;QAAE,KAAK,CAAC,IAAI,CAAC,UAAU,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC;IACtD,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;QACxB,KAAK,CAAC,IAAI,CAAC,mBAAmB,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACjE,IAAI,qBAAqB,CAAC,KAAK,CAAC,EAAE,CAAC;YACjC,KAAK,CAAC,IAAI,CAAC,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M,EAAE,uBAAuB;KAChC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
-
|
|
2
|
+
import type { Bridge } from "../bridge.js";
|
|
3
|
+
import type { ExportLayout } from "../layout.js";
|
|
4
|
+
export declare const KNOWLEDGE_V4 = "# ProjectionLab & FIRE Reference\n\nCurated concepts for analyzing retirement plans through this MCP server.\n\nProjectionLab v5 is in early access; this reference and the tool descriptions\ndescribe the current release, 4.6.0\n(https://projectionlab.com/help/projectionlab-v5-early-access-guide).\n\n## How to use this reference\n\n- **Explain, do not recommend.** Say what a term means, what ProjectionLab does\n with it, and what the user can look at in the app to decide. Do not tell the\n user what to do with their money and do not predict a personal outcome. This\n is information and education, not personalized financial advice; the decision\n belongs to the user and a licensed professional.\n- **Concepts only; ProjectionLab owns the yearly figures.** The app applies the\n current tax brackets, standard deduction, IRMAA tiers, RMD ages, contribution\n limits and ACA subsidies, and the user sees those numbers in the app (Tax\n Analytics). Never state a yearly figure from memory: they change every year.\n Ask the user to read the current one in ProjectionLab.\n\n## Evidence legend\n\nWhen evaluating plan elements or answering user questions, anchor claims with tags:\n- **[EXACT]**: Verified directly from plan JSON via tool inspection or output.\n- **[INFERRED]**: Derived logically from adjacent plan data or standard rule interactions.\n- **[ASSUMPTION]**: A placeholder, default, or external benchmark where plan data is absent.\n\n## ProjectionLab data model (quick map)\n\n- **plans[]**: each plan is a milestone-driven simulation.\n - **milestones[]**: lifecycle events (retirement, Medicare, death) keyed by\n date/year/milestone-relative criteria. Other events reference milestone IDs.\n Retirement and Life Expectancy always exist in the app and its delete\n control is disabled for them, so never remove either one\n (https://projectionlab.com/help/manage-milestones).\n - **income.events[]**: salary, Social Security, pension, inheritance; start/end\n reference milestone IDs.\n - **expenses.events[]**: living, travel, healthcare, LTC; carry a\n `spendingType` (essential vs discretionary).\n - **accounts.events[]**: investment accounts with `rothConversions`\n schedules, withdrawal rules, and bond/equity allocation glidepaths. A custom\n growth or dividend rate on one account covers its stock portion only; the\n bonds there follow the plan-level bond settings unless that account's bond\n allocation is 0%\n (https://projectionlab.com/help/growth-dividend-settings-chance-of-success).\n - **assets.events[]**: real estate, vehicles with appreciation/depreciation.\n - **variables**: tax settings, inflation, returns, drawdown order, IRMAA,\n estate config.\n - **withdrawalStrategy**: a separate mode, not the plan's normal drawdown\n policy. From the year or milestone it starts, its rule replaces most other\n plan events, such as expenses and asset purchases, so most plans leave it\n off (https://projectionlab.com/help/withdrawal-strategy-mode).\n - **montecarlo**: Chance of Success settings (review only; cannot be run\n remotely). Chance of Success runs many trials over historical market periods\n by default, with randomized (Monte Carlo) sampling as an option\n (https://projectionlab.com/help/plan-vs-chance-of-success).\n - **priorities.events[]**: savings contribution ordering. An \"Always Fund\"\n flow is paid even when income falls short: ProjectionLab sells from other\n accounts to cover it (https://projectionlab.com/help/mandatory-goals).\n- **today / currentFinances**: actual account balances; `accountId` links these\n to plan `accounts.events[]`.\n- Chance of Success trials and projection *math* run only in the ProjectionLab\n UI. This server reads/writes the plan definition; it does not compute\n projections.\n\n## Plan-change outcome metrics\n\nEvaluate a plan change primarily with ProjectionLab's projected ending net worth\nand Chance of Success from a completed simulation. Current Finances net worth is\nan input balance sheet, not an outcome. Mutation before/after values verify that\nthe requested input changed; they do not measure its financial impact. The\nPlugin API currently does not expose a supported calculation/result method, so\nrecalculate both outcomes in the UI after applying a change.\n\n## Account tax vocabulary\n\nUse three words for every account, and use them consistently:\n\n- **taxable**: funded with after-tax money; interest, dividends and gains are\n taxed in the year they are received.\n- **tax-deferred**: traditional 401(k) and IRA. Contributions lower taxable\n income now; withdrawals are taxed as ordinary income later.\n- **tax-free**: Roth accounts, and an HSA spent on healthcare. Qualified\n withdrawals are not taxed.\n\nDo not use \"pre-tax\" or \"post-tax\" as account names; they blur the line between\ntax-deferred and taxable.\n\n## Core FIRE / decumulation concepts\n\n- **Safe Withdrawal Rate (SWR)**: the share of the portfolio taken out in the\n first year of drawdown. The classic \"4% rule\" (Trinity study) is a starting\n heuristic for a 30-year horizon, not a guarantee; a longer horizon argues for\n a lower start. The portfolio withdrawal a plan needs falls as guaranteed\n income (Social Security, pension) switches on.\n- **Sequence-of-returns risk**: poor returns in the first years of drawdown do\n far more damage than the same returns later. Common mitigations: a cash/bond\n bridge, and a **rising-equity glidepath** (\"bond tent\" - most bonds at\n retirement, equity rising after).\n- **Asset location**: which account holds which asset. A common convention\n places bonds in tax-deferred accounts, high-growth equity in tax-free (Roth,\n HSA) accounts, and tax-efficient equity and cash in taxable. Location changes\n after-tax return without changing the overall allocation.\n- **Roth conversion**: moving money from a tax-deferred account into a tax-free\n one. The converted amount is taxed as ordinary income in the year of the\n conversion. A \"Roth conversion ladder\" converts in low-income years (often\n the window after work ends and before Social Security or RMDs start) to fill\n a low bracket, lower later RMDs, and shrink the taxable estate. Paying that\n year's tax from a taxable account rather than from withholding keeps more\n money inside the tax-free account.\n\n## Tax concepts that gate conversions\n\nOnly the shape of each rule is here. ProjectionLab computes with the\ncurrent-year figures, and the user reads them in Tax Analytics. MAGI means\nmodified adjusted gross income; each program (ACA, IRMAA, NIIT) defines it\nslightly differently.\n\n- **Federal income tax brackets**: ordinary income is taxed in bands. Income\n that fills an unused low band is cheap; income pushed into the next band\n costs more. What a conversion costs depends on where it lands.\n- **ACA premium subsidies**: marketplace health coverage is income-tested. In\n some income ranges extra income can cut a subsidy faster than tax does, so\n the effective marginal rate in those pre-Medicare years is higher than the\n bracket alone suggests. Not a factor with employer, retiree or other\n non-marketplace coverage.\n- **IRMAA**: an extra charge on Medicare Part B and Part D premiums. It is set\n by the person's MAGI from two years earlier and comes in tiers, so income\n just over a tier boundary pays the whole higher charge. A conversion in one\n year can raise premiums two years later. If the user is already on Medicare\n when the plan starts, ProjectionLab estimates that lookback income in the\n first two plan years, and the actual rule applies from year 3\n (https://projectionlab.com/help/modeling-irmaa-surcharges).\n- **NIIT (net investment income tax)**: a surtax on investment income (gains,\n dividends, interest, rent) once MAGI is above an income threshold. It raises\n the cost of a year that mixes a conversion with investment income.\n- **Long-term capital gains rate**: while taxable income stays under a\n threshold, long-term gains are taxed at 0%. A low-income year can realize\n some gains at no tax cost before that room is gone.\n- **RMDs (Required Minimum Distributions)**: once a person reaches the RMD age,\n tax-deferred accounts require a withdrawal every year, whether or not the\n cash is needed. A large tax-deferred balance can push those forced\n withdrawals into higher brackets and IRMAA tiers, which is the usual reason\n people convert while their income is still low.\n\n## Analysis checklist\n\n1. Build a lifecycle timeline (phase, date range, milestone trigger).\n2. Cash flow by phase; flag pure-drawdown years and the gap before Social\n Security starts.\n3. Withdrawal rate now and after guaranteed income begins.\n4. Sequence risk: what a poor-return start does to the plan. Only a run in the\n ProjectionLab UI can show it.\n5. Roth conversion efficiency: bracket headroom versus the ACA, IRMAA and NIIT\n ceilings; compare lifetime taxes and net legacy, not just the tax now.\n6. Longevity: does the plan last well past life expectancy?\n7. Inflation: healthcare and long-term care costs rise with inflation and are\n often decades out; check how the plan assumes them.\n\n## ProjectionLab help articles\n\nProjectionLab's own pages, linked for the user and summarized here for a model\nwith no web access. The bracketed tag is the plan section or area this reference\nuses for it. The summaries are ours, not ProjectionLab's wording. Glossary of\nfinancial terms: https://projectionlab.com/financial-terms\n\n- **Withdrawal Strategy mode** [withdrawalStrategy]\n https://projectionlab.com/help/withdrawal-strategy-mode - a comparison mode\n for classic rules (initial percentage, variable percentage withdrawal,\n Guyton-Klinger) that starts at a chosen year or milestone. While it is on,\n its rule replaces most other plan events, so most plans leave it off.\n- **Flows, the cash flow priorities** [priorities]\n https://projectionlab.com/help/cash-flow-priorities - Flows (the\n `priorities` section in the data) send income to savings goals,\n contributions, extra debt payments and transfers, earliest-added first.\n- **Mandatory goals (\"Always Fund\")** [priorities]\n https://projectionlab.com/help/mandatory-goals - an Always Fund flow is paid\n ahead of the other flows, selling from other accounts when income falls short.\n- **Milestones** [milestones]\n https://projectionlab.com/help/manage-milestones - lifecycle markers\n triggered by age, date, balance, or a combination of criteria; other events\n anchor their start and end to them. Retirement and Life Expectancy cannot be\n deleted.\n- **Drawdown order** [variables; the chart is app only]\n https://projectionlab.com/help/drawdown-order-visualization - the order\n accounts are liquidated in to cover a yearly shortfall. The graph and its red\n early-withdrawal penalty line are a UI view of that order.\n- **Roth conversions** [accounts; the optimizer is app only]\n https://projectionlab.com/help/roth-conversion - Optimize searches conversion\n strategies against brackets, IRMAA and legacy goals with a beam search, then\n writes the chosen schedule into the plan's accounts. This server can read and\n edit such a schedule; it cannot run the search.\n- **Bond allocation and location** [accounts, variables]\n https://projectionlab.com/help/bond-allocation-and-overrides - the bond\n percentage is set plan-wide and can be overridden per account, and the other\n accounts adjust to keep the plan-wide target, with a warning when it cannot\n balance. Bond location chooses which accounts hold bonds first.\n- **Custom growth and dividend rates** [accounts]\n https://projectionlab.com/help/growth-dividend-settings-chance-of-success - an\n account's custom growth or dividend rate covers its stock portion; the bond\n portion follows the plan's bond settings unless the account's bond allocation\n is overridden to 0%. In Chance of Success such a rate is either held fixed or\n sampled like the rest of the simulation.\n- **IRMAA surcharges** [variables; the optimizer is app only]\n https://projectionlab.com/help/modeling-irmaa-surcharges - tiered Medicare\n Part B and Part D surcharges set by MAGI two years earlier, where crossing a\n tier by any amount costs the whole surcharge. When the user is already on\n Medicare at plan start, ProjectionLab estimates the lookback income for the\n first two plan years.\n- **Plan vs Chance of Success** [montecarlo; results are app only]\n https://projectionlab.com/help/plan-vs-chance-of-success - the Plan tab is one\n fixed path at fixed growth; Chance of Success runs many trials over historical\n or randomized market data. All other tabs follow the Plan tab, not the trial\n outcomes.\n- **Simulation engine** [app only]\n https://projectionlab.com/help/simulation-engine - the app simulates a full\n year at a time (income, withholding, expenses, debt, dividends, prior-year\n taxes, RMDs) and turns a surplus into savings and a shortfall into\n withdrawals.\n- **Flexible spending** [expenses; the feature is app only]\n https://projectionlab.com/help/flex-spending - an optional rule that raises\n or cuts spending with portfolio performance against earlier all-time highs,\n scoped either to all spending or to discretionary expenses only.\n- **Plugins and external accounts** [Current Finances; app only]\n https://projectionlab.com/help/plugins - ProjectionLab does not link to banks;\n plugins (Lunch Money, YNAB, Monarch, or your own code) write balances into\n Current Finances through the Plugin API, which has to be enabled in account\n settings. This server uses that same API.\n";
|
|
5
|
+
export declare const KNOWLEDGE = "# ProjectionLab & FIRE Reference\n\nCurated concepts for analyzing retirement plans through this MCP server.\n\nProjectionLab v5 is in early access; this reference and the tool descriptions\ndescribe the current release, 4.6.0\n(https://projectionlab.com/help/projectionlab-v5-early-access-guide).\n\n## How to use this reference\n\n- **Explain, do not recommend.** Say what a term means, what ProjectionLab does\n with it, and what the user can look at in the app to decide. Do not tell the\n user what to do with their money and do not predict a personal outcome. This\n is information and education, not personalized financial advice; the decision\n belongs to the user and a licensed professional.\n- **Concepts only; ProjectionLab owns the yearly figures.** The app applies the\n current tax brackets, standard deduction, IRMAA tiers, RMD ages, contribution\n limits and ACA subsidies, and the user sees those numbers in the app (Tax\n Analytics). Never state a yearly figure from memory: they change every year.\n Ask the user to read the current one in ProjectionLab.\n\n## Evidence legend\n\nWhen evaluating plan elements or answering user questions, anchor claims with tags:\n- **[EXACT]**: Verified directly from plan JSON via tool inspection or output.\n- **[INFERRED]**: Derived logically from adjacent plan data or standard rule interactions.\n- **[ASSUMPTION]**: A placeholder, default, or external benchmark where plan data is absent.\n\n## ProjectionLab data model (quick map)\n\n- **plans[]**: each plan is a milestone-driven simulation.\n - **milestones[]**: lifecycle events (retirement, Medicare, death) keyed by\n date/year/milestone-relative criteria. Other events reference milestone IDs.\n Retirement and Life Expectancy always exist in the app and its delete\n control is disabled for them, so never remove either one\n (https://projectionlab.com/help/manage-milestones).\n - **income.events[]**: salary, Social Security, pension, inheritance; start/end\n reference milestone IDs.\n - **expenses.events[]**: living, travel, healthcare, LTC; carry a\n `spendingType` (essential vs discretionary).\n - **accounts.events[]**: investment accounts with `rothConversions`\n schedules, withdrawal rules, and bond/equity allocation glidepaths. A custom\n growth or dividend rate on one account covers its stock portion only; the\n bonds there follow the plan-level bond settings unless that account's bond\n allocation is 0%\n (https://projectionlab.com/help/growth-dividend-settings-chance-of-success).\n - **assets.events[]**: real estate, vehicles with appreciation/depreciation.\n - **variables**: tax settings, inflation, returns, drawdown order, IRMAA,\n estate config.\n - **withdrawalStrategy**: a separate mode, not the plan's normal drawdown\n policy. From the year or milestone it starts, its rule replaces most other\n plan events, such as expenses and asset purchases, so most plans leave it\n off (https://projectionlab.com/help/withdrawal-strategy-mode).\n - **montecarlo**: Chance of Success settings (review only; cannot be run\n remotely). Chance of Success runs many trials over historical market periods\n by default, with randomized (Monte Carlo) sampling as an option\n (https://projectionlab.com/help/plan-vs-chance-of-success).\n - **priorities.events[]**: savings contribution ordering. An \"Always Fund\"\n flow is paid even when income falls short: ProjectionLab sells from other\n accounts to cover it (https://projectionlab.com/help/mandatory-goals).\n- **today / currentFinances**: actual account balances; `accountId` links these\n to plan `accounts.events[]`.\n- Chance of Success trials and projection *math* run only in the ProjectionLab\n UI. This server reads/writes the plan definition; it does not compute\n projections.\n\n## Plan-change outcome metrics\n\nEvaluate a plan change primarily with ProjectionLab's projected ending net worth\nand Chance of Success from a completed simulation. Current Finances net worth is\nan input balance sheet, not an outcome. Mutation before/after values verify that\nthe requested input changed; they do not measure its financial impact. The\nPlugin API currently does not expose a supported calculation/result method, so\nrecalculate both outcomes in the UI after applying a change.\n\n## Account tax vocabulary\n\nUse three words for every account, and use them consistently:\n\n- **taxable**: funded with after-tax money; interest, dividends and gains are\n taxed in the year they are received.\n- **tax-deferred**: traditional 401(k) and IRA. Contributions lower taxable\n income now; withdrawals are taxed as ordinary income later.\n- **tax-free**: Roth accounts, and an HSA spent on healthcare. Qualified\n withdrawals are not taxed.\n\nDo not use \"pre-tax\" or \"post-tax\" as account names; they blur the line between\ntax-deferred and taxable.\n\n## Core FIRE / decumulation concepts\n\n- **Safe Withdrawal Rate (SWR)**: the share of the portfolio taken out in the\n first year of drawdown. The classic \"4% rule\" (Trinity study) is a starting\n heuristic for a 30-year horizon, not a guarantee; a longer horizon argues for\n a lower start. The portfolio withdrawal a plan needs falls as guaranteed\n income (Social Security, pension) switches on.\n- **Sequence-of-returns risk**: poor returns in the first years of drawdown do\n far more damage than the same returns later. Common mitigations: a cash/bond\n bridge, and a **rising-equity glidepath** (\"bond tent\" - most bonds at\n retirement, equity rising after).\n- **Asset location**: which account holds which asset. A common convention\n places bonds in tax-deferred accounts, high-growth equity in tax-free (Roth,\n HSA) accounts, and tax-efficient equity and cash in taxable. Location changes\n after-tax return without changing the overall allocation.\n- **Roth conversion**: moving money from a tax-deferred account into a tax-free\n one. The converted amount is taxed as ordinary income in the year of the\n conversion. A \"Roth conversion ladder\" converts in low-income years (often\n the window after work ends and before Social Security or RMDs start) to fill\n a low bracket, lower later RMDs, and shrink the taxable estate. Paying that\n year's tax from a taxable account rather than from withholding keeps more\n money inside the tax-free account.\n\n## Tax concepts that gate conversions\n\nOnly the shape of each rule is here. ProjectionLab computes with the\ncurrent-year figures, and the user reads them in Tax Analytics. MAGI means\nmodified adjusted gross income; each program (ACA, IRMAA, NIIT) defines it\nslightly differently.\n\n- **Federal income tax brackets**: ordinary income is taxed in bands. Income\n that fills an unused low band is cheap; income pushed into the next band\n costs more. What a conversion costs depends on where it lands.\n- **ACA premium subsidies**: marketplace health coverage is income-tested. In\n some income ranges extra income can cut a subsidy faster than tax does, so\n the effective marginal rate in those pre-Medicare years is higher than the\n bracket alone suggests. Not a factor with employer, retiree or other\n non-marketplace coverage.\n- **IRMAA**: an extra charge on Medicare Part B and Part D premiums. It is set\n by the person's MAGI from two years earlier and comes in tiers, so income\n just over a tier boundary pays the whole higher charge. A conversion in one\n year can raise premiums two years later. If the user is already on Medicare\n when the plan starts, ProjectionLab estimates that lookback income in the\n first two plan years, and the actual rule applies from year 3\n (https://projectionlab.com/help/modeling-irmaa-surcharges).\n- **NIIT (net investment income tax)**: a surtax on investment income (gains,\n dividends, interest, rent) once MAGI is above an income threshold. It raises\n the cost of a year that mixes a conversion with investment income.\n- **Long-term capital gains rate**: while taxable income stays under a\n threshold, long-term gains are taxed at 0%. A low-income year can realize\n some gains at no tax cost before that room is gone.\n- **RMDs (Required Minimum Distributions)**: once a person reaches the RMD age,\n tax-deferred accounts require a withdrawal every year, whether or not the\n cash is needed. A large tax-deferred balance can push those forced\n withdrawals into higher brackets and IRMAA tiers, which is the usual reason\n people convert while their income is still low.\n\n## Analysis checklist\n\n1. Build a lifecycle timeline (phase, date range, milestone trigger).\n2. Cash flow by phase; flag pure-drawdown years and the gap before Social\n Security starts.\n3. Withdrawal rate now and after guaranteed income begins.\n4. Sequence risk: what a poor-return start does to the plan. Only a run in the\n ProjectionLab UI can show it.\n5. Roth conversion efficiency: bracket headroom versus the ACA, IRMAA and NIIT\n ceilings; compare lifetime taxes and net legacy, not just the tax now.\n6. Longevity: does the plan last well past life expectancy?\n7. Inflation: healthcare and long-term care costs rise with inflation and are\n often decades out; check how the plan assumes them.\n\n## ProjectionLab help articles\n\nProjectionLab's own pages, linked for the user and summarized here for a model\nwith no web access. The bracketed tag is the plan section or area this reference\nuses for it. The summaries are ours, not ProjectionLab's wording. Glossary of\nfinancial terms: https://projectionlab.com/financial-terms\n\n- **Withdrawal Strategy mode** [withdrawalStrategy]\n https://projectionlab.com/help/withdrawal-strategy-mode - a comparison mode\n for classic rules (initial percentage, variable percentage withdrawal,\n Guyton-Klinger) that starts at a chosen year or milestone. While it is on,\n its rule replaces most other plan events, so most plans leave it off.\n- **Flows, the cash flow priorities** [priorities]\n https://projectionlab.com/help/cash-flow-priorities - Flows (the\n `priorities` section in the data) send income to savings goals,\n contributions, extra debt payments and transfers, earliest-added first.\n- **Mandatory goals (\"Always Fund\")** [priorities]\n https://projectionlab.com/help/mandatory-goals - an Always Fund flow is paid\n ahead of the other flows, selling from other accounts when income falls short.\n- **Milestones** [milestones]\n https://projectionlab.com/help/manage-milestones - lifecycle markers\n triggered by age, date, balance, or a combination of criteria; other events\n anchor their start and end to them. Retirement and Life Expectancy cannot be\n deleted.\n- **Drawdown order** [variables; the chart is app only]\n https://projectionlab.com/help/drawdown-order-visualization - the order\n accounts are liquidated in to cover a yearly shortfall. The graph and its red\n early-withdrawal penalty line are a UI view of that order.\n- **Roth conversions** [accounts; the optimizer is app only]\n https://projectionlab.com/help/roth-conversion - Optimize searches conversion\n strategies against brackets, IRMAA and legacy goals with a beam search, then\n writes the chosen schedule into the plan's accounts. This server can read and\n edit such a schedule; it cannot run the search.\n- **Bond allocation and location** [accounts, variables]\n https://projectionlab.com/help/bond-allocation-and-overrides - the bond\n percentage is set plan-wide and can be overridden per account, and the other\n accounts adjust to keep the plan-wide target, with a warning when it cannot\n balance. Bond location chooses which accounts hold bonds first.\n- **Custom growth and dividend rates** [accounts]\n https://projectionlab.com/help/growth-dividend-settings-chance-of-success - an\n account's custom growth or dividend rate covers its stock portion; the bond\n portion follows the plan's bond settings unless the account's bond allocation\n is overridden to 0%. In Chance of Success such a rate is either held fixed or\n sampled like the rest of the simulation.\n- **IRMAA surcharges** [variables; the optimizer is app only]\n https://projectionlab.com/help/modeling-irmaa-surcharges - tiered Medicare\n Part B and Part D surcharges set by MAGI two years earlier, where crossing a\n tier by any amount costs the whole surcharge. When the user is already on\n Medicare at plan start, ProjectionLab estimates the lookback income for the\n first two plan years.\n- **Plan vs Chance of Success** [montecarlo; results are app only]\n https://projectionlab.com/help/plan-vs-chance-of-success - the Plan tab is one\n fixed path at fixed growth; Chance of Success runs many trials over historical\n or randomized market data. All other tabs follow the Plan tab, not the trial\n outcomes.\n- **Simulation engine** [app only]\n https://projectionlab.com/help/simulation-engine - the app simulates a full\n year at a time (income, withholding, expenses, debt, dividends, prior-year\n taxes, RMDs) and turns a surplus into savings and a shortfall into\n withdrawals.\n- **Flexible spending** [expenses; the feature is app only]\n https://projectionlab.com/help/flex-spending - an optional rule that raises\n or cuts spending with portfolio performance against earlier all-time highs,\n scoped either to all spending or to discretionary expenses only.\n- **Plugins and external accounts** [Current Finances; app only]\n https://projectionlab.com/help/plugins - ProjectionLab does not link to banks;\n plugins (Lunch Money, YNAB, Monarch, or your own code) write balances into\n Current Finances through the Plugin API, which has to be enabled in account\n settings. This server uses that same API.\n";
|
|
6
|
+
export declare const KNOWLEDGE_V5 = "# ProjectionLab 5 & FIRE Reference\n\nCurated concepts for analyzing retirement plans through this MCP server on ProjectionLab 5.\n\nProjectionLab 5 operates under Plugin API contract 2, using a multi-document export envelope.\n\n## How to use this reference\n\n- **Explain, do not recommend.** Say what a term means, what ProjectionLab does\n with it, and what the user can look at in the app to decide. Do not tell the\n user what to do with their money and do not predict a personal outcome. This\n is information and education, not personalized financial advice; the decision\n belongs to the user and a licensed professional.\n- **Concepts only; ProjectionLab owns the yearly figures.** The app applies the\n current tax brackets, standard deduction, IRMAA tiers, RMD ages, contribution\n limits and ACA subsidies, and the user sees those numbers in the app (Tax\n Analytics). Never state a yearly figure from memory: they change every year.\n Ask the user to read the current one in ProjectionLab.\n\n## Evidence legend\n\nData 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.\n\nWhen evaluating plan elements or answering user questions, anchor claims with tags:\n- **[EXACT]**: Verified directly from plan JSON via tool inspection or output.\n- **[INFERRED]**: Derived logically from adjacent plan data or standard rule interactions.\n- **[ASSUMPTION]**: A placeholder, default, or external benchmark where plan data is absent.\n\n## ProjectionLab 5 data model (quick map)\n\n- **Root envelope**: `{ schema: 1, exportedAt, documents: { currentFinances, plans, settings, accountHistory } }`.\n Each document carries its own internal `schema` version.\n- **documents.currentFinances**: actual financial state and baseline balance sheet.\n - **household**: member demographics under `household.people.me` and `household.people.spouse`,\n with partnership filing status under `household.partnerStatus`.\n - **accounts**: all financial accounts, debts, and real property, stored as a map keyed by account ID.\n - Each record carries a `kind` discriminator: `\"account\"` (cash, investment, and retirement accounts\n with `balance` and `costBasis`), `\"debt\"` (liabilities with `balance` and optional `securedByAssetId`),\n or `\"real-asset\"` (physical property with `value` and `purchasePrice`).\n - Archived accounts carry an `archivedOn` ISO date string.\n - Supported account types: the Solo 401k, Roth Solo 401k, and SEP IRA account types store as\n `\"401k\"` or `\"roth-401k\"` with `subtype: \"solo\"`, and `\"ira\"` with `subtype: \"sep\"`.\n Observed type strings include `\"taxable\"`, `\"401k\"`, `\"savings\"`, `\"land\"`, and `\"secured-loan\"`.\n- **documents.plans[]**: milestone-driven simulation plans.\n - Plans carry no `active` flag. `settings.plan.activeId` and `settings.plan.baselineId` are\n reported as stored; no plan is treated as the selected plan.\n - Every plan event item carries a `kind` discriminator: `\"account\"`, `\"real-asset\"`,\n `\"income\"`, `\"expense\"`, or `\"priority\"`.\n - Timing for event start and end is defined by structured objects:\n `{ type: \"date\" | \"milestone\" | \"keyword\", value, modifier? }`.\n - **milestones[]**: lifecycle events (retirement, Medicare, death) triggered by date, year, age,\n or milestone-relative criteria. Other events anchor timing to milestone IDs.\n - **income.events[]**: salary, pensions, social security, other income.\n - **expenses.events[]**: living expenses carrying a `spendingType` (`\"essential\"` vs `\"discretionary\"`).\n - **accounts.events[]**: plan investment accounts, linking to Current Finances via `accountId`.\n - **assets.events[]**: real estate and physical assets with appreciation and depreciation, linking\n to Current Finances via `assetId`.\n - **variables**: tax settings, inflation, returns, drawdown order, IRMAA, estate rules.\n - **withdrawalStrategy**: alternative withdrawal policy mode (such as fixed percentage or Guyton-Klinger).\n - **montecarlo**: Chance of Success simulation parameters.\n - **priorities.events[]**: savings contribution ordering and cash flow routing. A priority's\n `accountId` is the id of the plan account event it routes cash to, not a Current Finances account id.\n - Event names need not be unique within a section; address an event by id when its name is ambiguous.\n- **documents.settings**:\n - **plan**: viewing preferences including `activeId` and `baselineId` (reported as stored),\n the account's year alignment (`alignment.type`: `\"calendar\"`, `\"rolling\"`, `\"au-tax\"`,\n `\"uk-tax\"` or `\"custom\"`), and pinned tabs. A plan can override the alignment in\n `variables.alignment`; null or absent means it follows the account.\n - **plugins**: plugin configuration with `enabled` status and `apiKey` (authentication secret,\n redacted on reads; sits at `documents.settings.plugins.apiKey`).\n- **documents.accountHistory**:\n - End-of-year balances, tax cost basis, and asset values tracked by account ID and calendar year\n under `documents.accountHistory.<accountId>.<year>`. Replaces the separate progress section.\n- Simulation math and Chance of Success trials run only in the ProjectionLab UI.\n This server reads the plan and financial definitions; it does not compute projections.\n\n## Plan-change outcome metrics\n\nEvaluate a plan change primarily with ProjectionLab's projected ending net worth\nand Chance of Success from a completed simulation. Current Finances net worth is\nan input balance sheet, not an outcome. Mutation before/after values verify that\nthe requested input changed; they do not measure its financial impact. The\nPlugin API currently does not expose a supported calculation/result method, so\nrecalculate both outcomes in the UI after applying a change.\n\n## Account tax vocabulary\n\nUse three words for every account, and use them consistently:\n\n- **taxable**: funded with after-tax money; interest, dividends and gains are\n taxed in the year they are received.\n- **tax-deferred**: traditional 401(k) and IRA. Contributions lower taxable\n income now; withdrawals are taxed as ordinary income later.\n- **tax-free**: Roth accounts, and an HSA spent on healthcare. Qualified\n withdrawals are not taxed.\n\nDo not use \"pre-tax\" or \"post-tax\" as account names; they blur the line between\ntax-deferred and taxable.\n\n## Core FIRE / decumulation concepts\n\n- **Safe Withdrawal Rate (SWR)**: the share of the portfolio taken out in the\n first year of drawdown. The classic \"4% rule\" (Trinity study) is a starting\n heuristic for a 30-year horizon, not a guarantee; a longer horizon argues for\n a lower start. The portfolio withdrawal a plan needs falls as guaranteed\n income (Social Security, pension) switches on.\n- **Sequence-of-returns risk**: poor returns in the first years of drawdown do\n far more damage than the same returns later. Common mitigations: a cash/bond\n bridge, and a **rising-equity glidepath** (\"bond tent\" - most bonds at\n retirement, equity rising after).\n- **Asset location**: which account holds which asset. A common convention\n places bonds in tax-deferred accounts, high-growth equity in tax-free (Roth,\n HSA) accounts, and tax-efficient equity and cash in taxable. Location changes\n after-tax return without changing the overall allocation.\n- **Roth conversion**: moving money from a tax-deferred account into a tax-free\n one. The converted amount is taxed as ordinary income in the year of the\n conversion. A \"Roth conversion ladder\" converts in low-income years (often\n the window after work ends and before Social Security or RMDs start) to fill\n a low bracket, lower later RMDs, and shrink the taxable estate. Paying that\n year's tax from a taxable account rather than from withholding keeps more\n money inside the tax-free account.\n\n## Tax concepts that gate conversions\n\nOnly the shape of each rule is here. ProjectionLab computes with the\ncurrent-year figures, and the user reads them in Tax Analytics. MAGI means\nmodified adjusted gross income; each program (ACA, IRMAA, NIIT) defines it\nslightly differently.\n\n- **Federal income tax brackets**: ordinary income is taxed in bands. Income\n that fills an unused low band is cheap; income pushed into the next band\n costs more. What a conversion costs depends on where it lands.\n- **ACA premium subsidies**: marketplace health coverage is income-tested. In\n some income ranges extra income can cut a subsidy faster than tax does, so\n the effective marginal rate in those pre-Medicare years is higher than the\n bracket alone suggests. Not a factor with employer, retiree or other\n non-marketplace coverage.\n- **IRMAA**: an extra charge on Medicare Part B and Part D premiums. It is set\n by the person's MAGI from two years earlier and comes in tiers, so income\n just over a tier boundary pays the whole higher charge. A conversion in one\n year can raise premiums two years later. If the user is already on Medicare\n when the plan starts, ProjectionLab estimates that lookback income in the\n first two plan years, and the actual rule applies from year 3\n (https://projectionlab.com/help/modeling-irmaa-surcharges).\n- **NIIT (net investment income tax)**: a surtax on investment income (gains,\n dividends, interest, rent) once MAGI is above an income threshold. It raises\n the cost of a year that mixes a conversion with investment income.\n- **Long-term capital gains rate**: while taxable income stays under a\n threshold, long-term gains are taxed at 0%. A low-income year can realize\n some gains at no tax cost before that room is gone.\n- **RMDs (Required Minimum Distributions)**: once a person reaches the RMD age,\n tax-deferred accounts require a withdrawal every year, whether or not the\n cash is needed. A large tax-deferred balance can push those forced\n withdrawals into higher brackets and IRMAA tiers, which is the usual reason\n people convert while their income is still low.\n\n## Analysis checklist\n\n1. Build a lifecycle timeline (phase, date range, milestone trigger).\n2. Cash flow by phase; flag pure-drawdown years and the gap before Social\n Security starts.\n3. Withdrawal rate now and after guaranteed income begins.\n4. Sequence risk: what a poor-return start does to the plan. Only a run in the\n ProjectionLab UI can show it.\n5. Roth conversion efficiency: bracket headroom versus the ACA, IRMAA and NIIT\n ceilings; compare lifetime taxes and net legacy, not just the tax now.\n6. Longevity: does the plan last well past life expectancy?\n7. Inflation: healthcare and long-term care costs rise with inflation and are\n often decades out; check how the plan assumes them.\n\n## ProjectionLab help articles\n\nProjectionLab's own pages, linked for the user and summarized here for a model\nwith no web access. The bracketed tag is the plan section or area this reference\nuses for it. The summaries are ours, not ProjectionLab's wording. Glossary of\nfinancial terms: https://projectionlab.com/financial-terms\n\n- **Withdrawal Strategy mode** [withdrawalStrategy]\n https://projectionlab.com/help/withdrawal-strategy-mode - a comparison mode\n for classic rules (initial percentage, variable percentage withdrawal,\n Guyton-Klinger) that starts at a chosen year or milestone. While it is on,\n its rule replaces most other plan events, so most plans leave it off.\n- **Flows, the cash flow priorities** [priorities]\n https://projectionlab.com/help/cash-flow-priorities - Flows (the\n `priorities` section in the data) send income to savings goals,\n contributions, extra debt payments and transfers, earliest-added first.\n- **Mandatory goals (\"Always Fund\")** [priorities]\n https://projectionlab.com/help/mandatory-goals - an Always Fund flow is paid\n ahead of the other flows, selling from other accounts when income falls short.\n- **Milestones** [milestones]\n https://projectionlab.com/help/manage-milestones - lifecycle markers\n triggered by age, date, balance, or a combination of criteria; other events\n anchor their start and end to them. Retirement and Life Expectancy cannot be\n deleted.\n- **Drawdown order** [variables; the chart is app only]\n https://projectionlab.com/help/drawdown-order-visualization - the order\n accounts are liquidated in to cover a yearly shortfall. The graph and its red\n early-withdrawal penalty line are a UI view of that order.\n- **Roth conversions** [accounts; the optimizer is app only]\n https://projectionlab.com/help/roth-conversion - Optimize searches conversion\n strategies against brackets, IRMAA and legacy goals with a beam search, then\n writes the chosen schedule into the plan's accounts. This server can read and\n edit such a schedule; it cannot run the search.\n- **Bond allocation and location** [accounts, variables]\n https://projectionlab.com/help/bond-allocation-and-overrides - the bond\n percentage is set plan-wide and can be overridden per account, and the other\n accounts adjust to keep the plan-wide target, with a warning when it cannot\n balance. Bond location chooses which accounts hold bonds first.\n- **Custom growth and dividend rates** [accounts]\n https://projectionlab.com/help/growth-dividend-settings-chance-of-success - an\n account's custom growth or dividend rate covers its stock portion; the bond\n portion follows the plan's bond settings unless the account's bond allocation\n is overridden to 0%. In Chance of Success such a rate is either held fixed or\n sampled like the rest of the simulation.\n- **IRMAA surcharges** [variables; the optimizer is app only]\n https://projectionlab.com/help/modeling-irmaa-surcharges - tiered Medicare\n Part B and Part D surcharges set by MAGI two years earlier, where crossing a\n tier by any amount costs the whole surcharge. When the user is already on\n Medicare at plan start, ProjectionLab estimates the lookback income for the\n first two plan years.\n- **Plan vs Chance of Success** [montecarlo; results are app only]\n https://projectionlab.com/help/plan-vs-chance-of-success - the Plan tab is one\n fixed path at fixed growth; Chance of Success runs many trials over historical\n or randomized market data. All other tabs follow the Plan tab, not the trial\n outcomes.\n- **Simulation engine** [app only]\n https://projectionlab.com/help/simulation-engine - the app simulates a full\n year at a time (income, withholding, expenses, debt, dividends, prior-year\n taxes, RMDs) and turns a surplus into savings and a shortfall into\n withdrawals.\n- **Flexible spending** [expenses; the feature is app only]\n https://projectionlab.com/help/flex-spending - an optional rule that raises\n or cuts spending with portfolio performance against earlier all-time highs,\n scoped either to all spending or to discretionary expenses only.\n- **Plugins and external accounts** [Current Finances; app only]\n https://projectionlab.com/help/plugins - ProjectionLab does not link to banks;\n plugins (Lunch Money, YNAB, Monarch, or your own code) write balances into\n Current Finances through the Plugin API, which has to be enabled in account\n settings. This server uses that same API.\n";
|
|
7
|
+
export declare function renderKnowledgeMarkdown(layout?: ExportLayout): string;
|
|
8
|
+
export declare function registerKnowledgeResource(server: McpServer, bridge?: Bridge): void;
|