projectionlab-mcp 1.4.1 → 1.5.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 +2 -2
- package/README.md +4 -2
- package/REFERENCE.md +20 -8
- package/dist/appBusy.d.ts +3 -0
- package/dist/appBusy.js +7 -0
- package/dist/appBusy.js.map +1 -0
- package/dist/appMap.d.ts +59 -0
- package/dist/appMap.js +595 -0
- package/dist/appMap.js.map +1 -0
- package/dist/appResultsPage.d.ts +31 -0
- package/dist/appResultsPage.js +427 -0
- package/dist/appResultsPage.js.map +1 -0
- package/dist/bootstrap.d.ts +3 -1
- package/dist/bootstrap.js +18 -3
- package/dist/bootstrap.js.map +1 -1
- package/dist/bridge.d.ts +42 -5
- package/dist/bridge.js +15 -1
- package/dist/bridge.js.map +1 -1
- package/dist/changeSummary.d.ts +129 -0
- package/dist/changeSummary.js +346 -0
- package/dist/changeSummary.js.map +1 -0
- package/dist/editAccess.d.ts +6 -3
- package/dist/editAccess.js +10 -3
- package/dist/editAccess.js.map +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/extensionBridge.d.ts +27 -6
- package/dist/extensionBridge.js +103 -11
- package/dist/extensionBridge.js.map +1 -1
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -1
- package/dist/instructions.d.ts +1 -1
- package/dist/instructions.js +2 -2
- package/dist/largeOutput.js +2 -23
- package/dist/largeOutput.js.map +1 -1
- package/dist/planEventTemplates.d.ts +35 -0
- package/dist/planEventTemplates.js +177 -0
- package/dist/planEventTemplates.js.map +1 -0
- package/dist/planReport.d.ts +9 -0
- package/dist/planReport.js +902 -0
- package/dist/planReport.js.map +1 -0
- package/dist/plans.d.ts +2 -0
- package/dist/plans.js +6 -0
- package/dist/plans.js.map +1 -1
- package/dist/printHtml.d.ts +8 -0
- package/dist/printHtml.js +144 -0
- package/dist/printHtml.js.map +1 -0
- package/dist/prompts/index.js +41 -11
- package/dist/prompts/index.js.map +1 -1
- package/dist/reportCopy.d.ts +16 -0
- package/dist/reportCopy.js +55 -0
- package/dist/reportCopy.js.map +1 -0
- package/dist/resources/appMap.d.ts +2 -0
- package/dist/resources/appMap.js +14 -0
- package/dist/resources/appMap.js.map +1 -0
- package/dist/resources/knowledge.d.ts +1 -1
- package/dist/resources/knowledge.js +302 -71
- package/dist/resources/knowledge.js.map +1 -1
- package/dist/retention.d.ts +8 -0
- package/dist/retention.js +35 -0
- package/dist/retention.js.map +1 -0
- package/dist/settingsReport.d.ts +35 -0
- package/dist/settingsReport.js +56 -22
- package/dist/settingsReport.js.map +1 -1
- package/dist/snapshot.d.ts +12 -0
- package/dist/snapshot.js +52 -2
- package/dist/snapshot.js.map +1 -1
- package/dist/tools/addPlanEvent.d.ts +4 -0
- package/dist/tools/addPlanEvent.js +301 -0
- package/dist/tools/addPlanEvent.js.map +1 -0
- package/dist/tools/clonePlan.d.ts +1 -1
- package/dist/tools/clonePlan.js +11 -1
- package/dist/tools/clonePlan.js.map +1 -1
- package/dist/tools/deletePlan.d.ts +1 -1
- package/dist/tools/deletePlan.js +10 -1
- package/dist/tools/deletePlan.js.map +1 -1
- package/dist/tools/findInApp.d.ts +2 -0
- package/dist/tools/findInApp.js +31 -0
- package/dist/tools/findInApp.js.map +1 -0
- package/dist/tools/listChanges.d.ts +3 -0
- package/dist/tools/listChanges.js +147 -0
- package/dist/tools/listChanges.js.map +1 -0
- package/dist/tools/planReport.d.ts +3 -0
- package/dist/tools/planReport.js +62 -0
- package/dist/tools/planReport.js.map +1 -0
- package/dist/tools/projection.d.ts +3 -0
- package/dist/tools/projection.js +381 -0
- package/dist/tools/projection.js.map +1 -0
- package/dist/tools/removePlanEvent.d.ts +4 -0
- package/dist/tools/removePlanEvent.js +196 -0
- package/dist/tools/removePlanEvent.js.map +1 -0
- package/dist/tools/restore.d.ts +1 -1
- package/dist/tools/restore.js +30 -6
- package/dist/tools/restore.js.map +1 -1
- package/dist/tools/settingsReport.js +23 -4
- package/dist/tools/settingsReport.js.map +1 -1
- package/dist/tools/snapshots.d.ts +1 -1
- package/dist/tools/snapshots.js +65 -31
- package/dist/tools/snapshots.js.map +1 -1
- package/dist/tools/updateAccount.d.ts +1 -1
- package/dist/tools/updateAccount.js +12 -1
- package/dist/tools/updateAccount.js.map +1 -1
- package/dist/tools/updatePlanEvent.d.ts +1 -1
- package/dist/tools/updatePlanEvent.js +19 -2
- package/dist/tools/updatePlanEvent.js.map +1 -1
- package/dist/tools/updatePlanSection.d.ts +1 -1
- package/dist/tools/updatePlanSection.js +19 -3
- package/dist/tools/updatePlanSection.js.map +1 -1
- package/dist/tools/updatePlanSettings.d.ts +1 -1
- package/dist/tools/updatePlanSettings.js +16 -4
- package/dist/tools/updatePlanSettings.js.map +1 -1
- package/dist/types/wire.d.ts +30 -2
- package/dist/types/wire.js +8 -0
- package/dist/types/wire.js.map +1 -1
- package/package.json +1 -1
- package/skills/projectionlab/SKILL.md +142 -18
package/HOW-IT-WORKS.md
CHANGED
|
@@ -19,7 +19,7 @@ The server opens a WebSocket listener on `127.0.0.1:<PL_WS_PORT>`. A browser-sid
|
|
|
19
19
|
`src/types/wire.ts` is the contract shared by the server and every executor:
|
|
20
20
|
|
|
21
21
|
- The executor connects and sends a `hello` frame with a shared token, the protocol version, and an `instanceId` (a stable id for the installation: the extension persists one UUID, the snippet generates one per page load). The server validates the `Origin` header (extension or app origin only), checks the token, and replies `helloAck`, or closes with code `4001` (auth), `4002` (version), `4003` (a takeover replaced this executor), or `4004` (busy: another executor holds the connection, retry later). The server keeps one active executor and the incumbent keeps it: a second authenticated executor is refused with `4004`, retries on a slow schedule, and connects by itself when the active one goes away. It takes over only by sending `takeover: true` in the hello (the extension does that when the user presses Save on its options page) or by repeating the incumbent's `instanceId`, which lets an executor replace its own stale socket. Several server instances (one per host session) can share the port the same way: one holds it and the others retry the bind. A waiting instance with an operation to run connects to the port and sends a `yield` frame carrying the token instead of a `hello`; the holder finishes its queued operations, releases the port, closes its executor with `1012` (an ordinary close, so the executor reconnects within seconds rather than standing by), and closes the yield socket with `4005`. The waiting instance binds the port at once and waits for the executor to reconnect. When several instances wait, the one that loses the bind asks the new holder in turn. A yield from a socket with an `Origin` header is refused, since only another server sends one. The `helloAck` carries the server's release version in `serverVersion` so the extension can show a mismatch line; executors that ignore the field are unaffected, and servers older than the field simply omit it.
|
|
22
|
-
- Requests are `{ id, method, params }`; responses are `{ id, ok, result | error }`. Methods map directly to Plugin API calls plus `describeApi`, `waitForApi`, and `apiVersion` (the page's `projectionlabPluginAPI.version`, or `null` when it has none).
|
|
22
|
+
- Requests are `{ id, method, params }`; responses are `{ id, ok, result | error }`. Methods map directly to Plugin API calls plus `describeApi`, `waitForApi`, and `apiVersion` (the page's `projectionlabPluginAPI.version`, or `null` when it has none). An executor whose `hello` lists the `appResults` feature also answers the app methods (`appState`, `openScreen`, `getProjection`, `startMonteCarlo`, `getMonteCarlo`). They run one page function, `src/appResultsPage.js`, shared by the extension and the snippet: it checks the API key with `validateApiKey`, then reads ProjectionLab's own results from the app's Pinia stores, opens the plan overview or Chance of Success screen through the app's router (never while a dialog is open), or presses the screen's Run button. It never computes a figure. The server does the waiting: it polls `appState` as separate operations until the projection revision is past the one a write reported and has been quiet for 1.5 seconds, so a hidden tab's throttled timers cannot stretch the wait. The app methods change no plan input and count as reads for the edits switch; pressing Run lets ProjectionLab reset the plan's stored chart metric when it is not one of the plan's metrics, as a press by the user does. Each write reads `appState` in the same operation, just before writing, refuses with `APP_BUSY` while Compare or What If is on, and returns the revisions it read; a page whose stores cannot be read lets the write go ahead without them.
|
|
23
23
|
- Writes are checked against the Plugin API contract three times. Each write tool reads the contract before it previews or snapshots anything and refuses a write the contract does not support (`WRITE_NOT_SUPPORTED`). The bridge reads it again in the same operation as the write and refuses a page that is not ProjectionLab 5 (`UNSUPPORTED_API_VERSION`); a plan write also refuses when the export it re-reads for its conflict check is not a ProjectionLab 5 export. An executor whose `hello` lists the `expectApiVersion` feature also gets that version on the write request as `expectApiVersion`, and calls the Plugin API only if the page still reports exactly that version, answering `CONTRACT_CHANGED` otherwise; the check and the call run in the same page turn, so a tab reloaded onto another ProjectionLab version in between is never written to. Every executor gets the write only on the socket the version was read from, so a browser that takes the connection over in between is not written to either.
|
|
24
24
|
- A ~20 s `ping`/`pong` heartbeat keeps the connection healthy (and keeps a Manifest V3 service worker from being suspended).
|
|
25
25
|
|
|
@@ -44,7 +44,7 @@ The server starts listening immediately. Tool calls made before an executor conn
|
|
|
44
44
|
3. The browser serializes your financial state to JSON and returns it.
|
|
45
45
|
4. The server selects or summarizes the requested data, redacts secrets where appropriate, and returns it to the MCP host. Results above the inline size limit are written to a protected local export file and returned as a file pointer. A short-lived export cache avoids re-serializing the complete state on every read; every write invalidates it.
|
|
46
46
|
|
|
47
|
-
### C. Write Operations & Safety Flow (`update_*`, `restore_*`, `clone_plan`)
|
|
47
|
+
### C. Write Operations & Safety Flow (`update_*`, `add_plan_event`, `remove_plan_event`, `restore_*`, `clone_plan`)
|
|
48
48
|
|
|
49
49
|
The Plugin API provides a targeted `updateAccount` operation for Current Finances and whole-area restore operations (`restorePlans` and the others) for everything else. Plan edits, including `clone_plan`, are built as a complete new plans array and written with `restorePlans`. The server builds safe patches on top of those primitives and enforces a multi-layered safety net:
|
|
50
50
|
|
package/README.md
CHANGED
|
@@ -25,12 +25,14 @@ Everything the assistant does, you could do by hand in ProjectionLab. What it ad
|
|
|
25
25
|
- **Refresh your balances.** Paste figures from your statements, or let another tool your assistant is connected to supply them, and it updates the matching accounts in Current Finances.
|
|
26
26
|
- **Audit your plan.** It looks for stale balances, expenses that end too early or never end, inconsistent growth or inflation settings, and benefit start ages that look unintended.
|
|
27
27
|
- **Explain your plan.** It produces a readable report of a plan's settings, ordered by topic, or two plans side by side, and tells you exactly which values differ between plans or since a backup.
|
|
28
|
-
- **
|
|
28
|
+
- **Find your way around.** It tells you which ProjectionLab screen and control holds a setting, including where ProjectionLab 5 moved things.
|
|
29
|
+
- **Export your plan's inputs.** It writes a document of one plan's inputs and assumptions, from your household and Current Finances to milestones, cash flows and the settings in effect, to keep or share, for example with an advisor. A print-ready copy opens in your browser to print or save as PDF.
|
|
30
|
+
- **Build scenarios fast.** "Copy my plan and retire two years earlier," "lower returns by 2 points," "add a home purchase in 2030." It builds the copies and reads ProjectionLab's results for each one you open.
|
|
29
31
|
- **Make bulk edits.** Raise every expense by a percentage, rename or tidy items, or apply the same change across several plans.
|
|
30
32
|
- **Think through tax strategy.** Talk through Roth conversions, tax brackets, and Medicare IRMAA thresholds against your own ages and income, then set up plan copies for ProjectionLab's Optimizer and projections to judge.
|
|
31
33
|
- **Undo and history.** See what changed and when, and roll any change back.
|
|
32
34
|
|
|
33
|
-
The assistant
|
|
35
|
+
ProjectionLab computes every result. The assistant can read ProjectionLab's projection and Chance of Success for the plan you have open, and start a Chance of Success run when you ask; it never calculates its own figures.
|
|
34
36
|
|
|
35
37
|
---
|
|
36
38
|
|
package/REFERENCE.md
CHANGED
|
@@ -104,15 +104,23 @@ The server starts without `PL_API_KEY` so it can tell the agent what is missing;
|
|
|
104
104
|
| `projectionlab_get_plan` | Retrieve a single plan | No |
|
|
105
105
|
| `projectionlab_get_plan_section` | Retrieve a plan section; supports event/path filters and typed field-path listing | No |
|
|
106
106
|
| `projectionlab_get_plan_settings` | List discrete plan settings as path-addressable values | No |
|
|
107
|
-
| `projectionlab_get_settings_report` | Render one plan's settings, or two plans' side by side with a Differs column, as a readable markdown report | No |
|
|
107
|
+
| `projectionlab_get_settings_report` | Render one plan's settings, or two plans' side by side with a Differs column, as a readable markdown report, and save a print-ready HTML copy under `~/.projectionlab-mcp/reports/` (kept 30 days) | No |
|
|
108
|
+
| `projectionlab_get_plan_report` | Render one plan's inputs and settings as "Plan Inputs and Assumptions", a markdown document to keep, print, or share (for example with a financial advisor), and save a print-ready HTML copy under `~/.projectionlab-mcp/reports/` (kept 30 days); holds no projections | No |
|
|
108
109
|
| `projectionlab_get_current_finances` | Get Current Finances or list typed paths for one account | No |
|
|
110
|
+
| `projectionlab_get_projection` | Read ProjectionLab's own projection of the plan open in the app (outcome, retirement and end-of-plan net worth, a yearly table, milestones, and the Compare reference's projection); opens the plan overview if needed and waits for a settled run. Pass a write's `projection` as `afterProjection` | No plan data; may change the screen |
|
|
111
|
+
| `projectionlab_run_chance_of_success` | Press Run on ProjectionLab's Chance of Success screen and return once the run has started | No plan input; replaces the previous run's results, and ProjectionLab may reset the stored chart metric. Works with plan edits off, with no confirm step |
|
|
112
|
+
| `projectionlab_get_chance_of_success` | Read ProjectionLab's latest Chance of Success run: progress, the chance of success, outcome counts, percentile bands, milestones and run settings. Pass a write's `chanceOfSuccessRunRevision` as `afterRunRevision` | No |
|
|
113
|
+
| `projectionlab_find_in_app` | Find where a screen, setting, field label, data path or older ProjectionLab name is in the ProjectionLab 5 app; needs no browser connection | No |
|
|
109
114
|
| `projectionlab_update_account` | Patch one Current Finances account by top-level fields or nested dot paths | Yes |
|
|
110
115
|
| `projectionlab_update_plan_event` | Patch one event by top-level fields or nested dot paths | Yes |
|
|
116
|
+
| `projectionlab_add_plan_event` | Add one income or expense item built from ProjectionLab's defaults for its type | Yes |
|
|
117
|
+
| `projectionlab_remove_plan_event` | Remove one income or expense item; refuses generated, locked, debt-payment and referenced items | Yes |
|
|
111
118
|
| `projectionlab_update_plan_settings` | Patch existing assumptions, Monte Carlo, or withdrawal settings by path | Yes |
|
|
112
119
|
| `projectionlab_update_plan_section` | Replace a whole section of a plan (dry-run by default) | Yes |
|
|
113
120
|
| `projectionlab_clone_plan` | Copy a plan to a new, named plan for what-if scenarios | Yes |
|
|
114
121
|
| `projectionlab_delete_plan` | Delete a plan by exact ID; refuses the last plan (dry-run by default) | Yes |
|
|
115
122
|
| `projectionlab_list_snapshots` | List saved pre-mutation snapshots | No |
|
|
123
|
+
| `projectionlab_list_changes` | List the confirmed writes since this server process started, oldest first, each with its plain-language change and the `projectionlab_rollback` call that undoes it; read from the shared snapshot folder, so another MCP host's writes in that window are listed too (`since` sets another window) | No |
|
|
116
124
|
| `projectionlab_diff` | Field-level changes between a snapshot and another snapshot or the live data, or between two plans (`planA` and `planB`) | No |
|
|
117
125
|
| `projectionlab_restore_current_finances` | Replace Current Finances with the supplied data | Yes |
|
|
118
126
|
| `projectionlab_restore_plans` | Replace all plans with the supplied array; an empty array is refused | Yes |
|
|
@@ -127,6 +135,7 @@ The server starts without `PL_API_KEY` so it can tell the agent what is missing;
|
|
|
127
135
|
| `projectionlab://summary` | High-level snapshot: net worth, account breakdown, plan count |
|
|
128
136
|
| `projectionlab://knowledge` | Curated ProjectionLab data-model + FIRE/tax reference (static) |
|
|
129
137
|
| `projectionlab://data-model` | Field meanings, units, and allowed values for path-addressable reads and writes, version-stamped to ProjectionLab 5.0.0 |
|
|
138
|
+
| `projectionlab://app-map` | Where things are in the ProjectionLab 5.0.0 app: each screen's name, click path, route, contents, plan data, help articles and labelled fields (static) |
|
|
130
139
|
| `projectionlab://guide` | Agent guide: setup walkthrough, tool selection, change workflow, privacy rules (static) |
|
|
131
140
|
|
|
132
141
|
## Prompts
|
|
@@ -136,11 +145,12 @@ The server starts without `PL_API_KEY` so it can tell the agent what is missing;
|
|
|
136
145
|
| `analyze-plan` | Structured analysis: cash flow, tax, risk, withdrawal, estate |
|
|
137
146
|
| `compare-plans` | Side-by-side comparison of two plans |
|
|
138
147
|
| `optimize-tax` | Roth conversion / bracket / IRMAA / gain-harvesting review |
|
|
148
|
+
| `plan-report` | One plan's inputs and assumptions as a document, with a print-ready copy |
|
|
139
149
|
| `review-assumptions` | Stress-test returns, inflation, healthcare, longevity |
|
|
140
150
|
|
|
141
151
|
## Safety model
|
|
142
152
|
|
|
143
|
-
Write operations (`update_*`, `restore_*`, `clone_plan`, `delete_plan`) default to **dry-run mode**. Pass `confirm: true` to execute. Before any confirmed mutation, the server automatically snapshots the affected data section to disk so you can roll back with `projectionlab_rollback`. Writes are disabled entirely unless the browser extension's **Enable agent plan edits** switch is on (its options page; off by default, takes effect at once). The extension refuses every write in the browser while the switch is off, and the server sends no write to an executor that does not report it on, so the console bootstrap snippet and extension releases without the switch can only read. `projectionlab_check_connection` reports the current state as `writesEnabled`.
|
|
153
|
+
Write operations (`update_*`, `add_plan_event`, `remove_plan_event`, `restore_*`, `clone_plan`, `delete_plan`) default to **dry-run mode**. Pass `confirm: true` to execute. Each dry run and confirmed result carries a `summary` field: the change in plain words, naming the plan and item and giving old and new values the way ProjectionLab shows them, built from the same redacted values as the JSON beside it. Before any confirmed mutation, the server automatically snapshots the affected data section to disk so you can roll back with `projectionlab_rollback`, or list the session's confirmed writes and the rollback call for each with `projectionlab_list_changes`. Writes are disabled entirely unless the browser extension's **Enable agent plan edits** switch is on (its options page; off by default, takes effect at once). The extension refuses every write in the browser while the switch is off, and the server sends no write to an executor that does not report it on, so the console bootstrap snippet and extension releases without the switch can only read. `projectionlab_check_connection` reports the current state as `writesEnabled`. Writes are also refused with `APP_BUSY` while ProjectionLab is in Compare or What If mode, checked in the dry run and again just before the write; a confirmed write's result carries `projection` and `chanceOfSuccessRunRevision`, the revisions read just before it, for the results tools.
|
|
144
154
|
|
|
145
155
|
Every write that replaces the plans array re-reads the plans just before writing and refuses with `PLAN_CONFLICT` if any plan was added, removed, or saved in ProjectionLab since the tool read them, so an edit made in the ProjectionLab UI, or a write by another agent's server instance, is never silently overwritten. `projectionlab_update_plan_section` also returns a `planVersion` in its dry run; pass it back as `expectedPlanVersion` when confirming to refuse the write if the plan was saved after the preview.
|
|
146
156
|
|
|
@@ -213,12 +223,14 @@ metrics for comparing a plan before and after a change. Current Finances
|
|
|
213
223
|
balances are inputs. Mutation before/after values verify that the requested
|
|
214
224
|
input changed, but they do not measure the plan's financial impact.
|
|
215
225
|
|
|
216
|
-
ProjectionLab's Plugin API
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
226
|
+
ProjectionLab's Plugin API has no method that returns results, so the
|
|
227
|
+
results tools read them from the app in the user's tab, for the plan open
|
|
228
|
+
there. After a confirmed mutation, re-read the targeted input for
|
|
229
|
+
verification, then call `projectionlab_get_projection` with the write's
|
|
230
|
+
`projection` as `afterProjection`. For Chance of Success, start a new run
|
|
231
|
+
with `projectionlab_run_chance_of_success` when the user asks, and read it
|
|
232
|
+
with `projectionlab_get_chance_of_success`. The server never computes a
|
|
233
|
+
result; every figure is ProjectionLab's.
|
|
222
234
|
|
|
223
235
|
## Secret handling
|
|
224
236
|
|
package/dist/appBusy.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ProjectionLabError } from "./errors.js";
|
|
2
|
+
/** The refusal for a write while Compare or What If is on (design 2.4). */
|
|
3
|
+
export function appBusyWriteError(whatIf) {
|
|
4
|
+
const mode = whatIf ? "What If" : "Compare";
|
|
5
|
+
return new ProjectionLabError("APP_BUSY", `ProjectionLab is in ${mode} mode, and plan changes are refused while it is on. Nothing was written.`, `Ask the user to finish ${mode} in ProjectionLab (keep, save or revert its changes, or close it), then try again.`);
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=appBusy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appBusy.js","sourceRoot":"","sources":["../src/appBusy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,2EAA2E;AAC3E,MAAM,UAAU,iBAAiB,CAAC,MAAe;IAC/C,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5C,OAAO,IAAI,kBAAkB,CAC3B,UAAU,EACV,uBAAuB,IAAI,0EAA0E,EACrG,0BAA0B,IAAI,oFAAoF,CACnH,CAAC;AACJ,CAAC"}
|
package/dist/appMap.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export declare const APP_MAP_PROJECTIONLAB_VERSION = "5.0.0";
|
|
2
|
+
export type AppMapEvidence = "bundle" | "observed";
|
|
3
|
+
export type AppMapArea = "Overview" | "Plan" | "Results" | "Optimize" | "Plan Settings" | "Account";
|
|
4
|
+
export interface AppScreen {
|
|
5
|
+
/** Stable key for the screen. */
|
|
6
|
+
id: string;
|
|
7
|
+
/**
|
|
8
|
+
* The screen's name as this server writes locations, e.g. "Plan Settings >
|
|
9
|
+
* Tax". `UI_LABELS_V5` locations start with a screen's name or one of its
|
|
10
|
+
* `locationNames`.
|
|
11
|
+
*/
|
|
12
|
+
name: string;
|
|
13
|
+
area: AppMapArea;
|
|
14
|
+
/** How to reach it, starting from the left sidebar or the profile menu. */
|
|
15
|
+
clickPath: string;
|
|
16
|
+
/** The URL path, when the screen has its own route. */
|
|
17
|
+
route?: string;
|
|
18
|
+
/** What the screen shows or edits, in the app's own words. */
|
|
19
|
+
holds: string;
|
|
20
|
+
/** Plan sections (`projectionlab_get_plan_section`) or export areas it edits. */
|
|
21
|
+
data?: readonly string[];
|
|
22
|
+
/** ProjectionLab help articles about it. */
|
|
23
|
+
help?: readonly string[];
|
|
24
|
+
/** Other names people use for it, including ProjectionLab 4 names. */
|
|
25
|
+
aliases?: readonly string[];
|
|
26
|
+
/** Further location heads in `UI_LABELS_V5` that point at this screen. */
|
|
27
|
+
locationNames?: readonly string[];
|
|
28
|
+
evidence: AppMapEvidence;
|
|
29
|
+
}
|
|
30
|
+
export declare const APP_SCREENS: readonly AppScreen[];
|
|
31
|
+
/**
|
|
32
|
+
* The screen a `UI_LABELS_V5` location belongs to: the one whose name or
|
|
33
|
+
* location name is the longest that starts the location and ends at a
|
|
34
|
+
* segment boundary.
|
|
35
|
+
*/
|
|
36
|
+
export declare function screenForLocation(location: string): AppScreen | undefined;
|
|
37
|
+
export interface AppField {
|
|
38
|
+
/** `<scope>.<path>`, as `projectionlab://data-model` names it. */
|
|
39
|
+
path: string;
|
|
40
|
+
label: string;
|
|
41
|
+
location: string;
|
|
42
|
+
screenId?: string;
|
|
43
|
+
}
|
|
44
|
+
/** Every labelled field, with the screen its location starts at. */
|
|
45
|
+
export declare function appFields(): AppField[];
|
|
46
|
+
export declare function renderAppMapMarkdown(): string;
|
|
47
|
+
export interface FindResult {
|
|
48
|
+
query: string;
|
|
49
|
+
projectionLabVersion: string;
|
|
50
|
+
screens: Array<Omit<AppScreen, "locationNames">>;
|
|
51
|
+
fields: AppField[];
|
|
52
|
+
note?: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The screens and labelled fields that match a query, best first. A screen
|
|
56
|
+
* matches on its name, aliases, data sections and contents; a field on its
|
|
57
|
+
* label, path or location.
|
|
58
|
+
*/
|
|
59
|
+
export declare function findInApp(query: string): FindResult;
|