projectionlab-mcp 1.2.2 → 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 +5 -4
- package/MANUAL-SETUP.md +8 -4
- package/README.md +1 -1
- package/REFERENCE.md +25 -9
- 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 +29 -6
- 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 +44 -8
- package/dist/extensionBridge.js +179 -30
- 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 +7 -2
- package/dist/planVersion.js +27 -11
- 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 -9
- 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 -8
- 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 -42
- 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 +39 -19
- 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 -27
- package/dist/tools/updatePlanEvent.js.map +1 -1
- package/dist/tools/updatePlanSection.js +9 -8
- package/dist/tools/updatePlanSection.js.map +1 -1
- package/dist/tools/updatePlanSettings.js +33 -13
- 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 +57 -8
- package/dist/types/wire.js +16 -2
- package/dist/types/wire.js.map +1 -1
- package/package.json +1 -1
- package/skills/projectionlab/SKILL.md +215 -17
package/dist/layout.d.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { ProjectionLabError } from "./errors.js";
|
|
2
|
+
import type { WireMethod } from "./types/wire.js";
|
|
3
|
+
/**
|
|
4
|
+
* ProjectionLab Plugin API contracts and export layouts.
|
|
5
|
+
*
|
|
6
|
+
* The Plugin API reports its contract major version as `api.version`: 2 on
|
|
7
|
+
* ProjectionLab 5, absent on ProjectionLab 4, so `api.version ?? 1` names the
|
|
8
|
+
* contract (ProjectionLab Plugin API reference, PluginAPI.version). The
|
|
9
|
+
* contract is independent of the app version and of the export schema.
|
|
10
|
+
*
|
|
11
|
+
* The two contracts export different layouts:
|
|
12
|
+
* - "v4" (contract 1): `{ meta, today, plans, settings, progress }`.
|
|
13
|
+
* - "v5" (contract 2): `{ schema, exportedAt, documents: { currentFinances,
|
|
14
|
+
* plans, settings, accountHistory, progress? } }`, each document carrying
|
|
15
|
+
* its own `schema`.
|
|
16
|
+
*/
|
|
17
|
+
export type ApiContract = 1 | 2;
|
|
18
|
+
export type ExportLayout = "v4" | "v5";
|
|
19
|
+
/**
|
|
20
|
+
* Write methods allowed on contract 2, each verified against ProjectionLab
|
|
21
|
+
* 5's Plugin API. The write tools and the bridge refuse any other write
|
|
22
|
+
* method on contract 2. Contract 1 allows every write method.
|
|
23
|
+
*
|
|
24
|
+
* restoreProgress is absent: ProjectionLab 5's restoreProgress always
|
|
25
|
+
* throws, because the app records Progress history itself whenever a
|
|
26
|
+
* current value changes.
|
|
27
|
+
*/
|
|
28
|
+
export declare const CONTRACT_2_WRITES: ReadonlySet<WireMethod>;
|
|
29
|
+
/** Whether `method` may write to a page offering `contract`. */
|
|
30
|
+
export declare function writeSupported(contract: ApiContract, method: WireMethod): boolean;
|
|
31
|
+
/** The refusal for a write method the page's contract does not offer. */
|
|
32
|
+
export declare function writeNotSupportedError(method: WireMethod): ProjectionLabError;
|
|
33
|
+
/** The contract named by a Plugin API `version` value. */
|
|
34
|
+
export declare function contractFromVersion(version: unknown): ApiContract;
|
|
35
|
+
export declare function layoutForContract(contract: ApiContract): ExportLayout;
|
|
36
|
+
/** The layout of a raw `exportData` result, from its shape. */
|
|
37
|
+
export declare function detectLayout(raw: unknown): ExportLayout;
|
|
38
|
+
/** An export's sections under one set of names, whichever layout it has. */
|
|
39
|
+
export interface ExportSections {
|
|
40
|
+
layout: ExportLayout;
|
|
41
|
+
/** Every plan document. */
|
|
42
|
+
plans: unknown[];
|
|
43
|
+
/** v4 `today`, v5 `documents.currentFinances`. */
|
|
44
|
+
currentFinances: unknown;
|
|
45
|
+
settings: unknown;
|
|
46
|
+
/** v4 `progress` (category totals). Absent from v5 unless the export
|
|
47
|
+
* carries older history; v5 keeps per-account history in `accountHistory`. */
|
|
48
|
+
progress: unknown;
|
|
49
|
+
/** v5 `documents.accountHistory`; undefined on v4. */
|
|
50
|
+
accountHistory: unknown;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Reads an export's sections. A v5 export without a plans array is refused
|
|
54
|
+
* rather than read as "no plans", since every v5 profile has a Main Plan and
|
|
55
|
+
* an empty list would pass plan conflict checks against a real one.
|
|
56
|
+
*/
|
|
57
|
+
export declare function exportSections(raw: unknown): ExportSections;
|
|
58
|
+
/** One named section of an export. */
|
|
59
|
+
export declare function sectionOf(raw: unknown, section: string): unknown;
|
|
60
|
+
/**
|
|
61
|
+
* Refuses a rollback of a snapshot taken from one export layout onto an
|
|
62
|
+
* account that now exports the other. A snapshot without a recorded layout
|
|
63
|
+
* predates layout tracking and is "v4". ProjectionLab 5 has no API path for
|
|
64
|
+
* v4 data: v4 backups are restored only through the app's own Restore action
|
|
65
|
+
* (ProjectionLab Plugin API reference, restore methods).
|
|
66
|
+
*/
|
|
67
|
+
export declare function assertSnapshotLayout(snapshotLayout: ExportLayout | undefined, live: ExportLayout): void;
|
|
68
|
+
export declare function layoutLabel(layout: ExportLayout): string;
|
package/dist/layout.js
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { ProjectionLabError } from "./errors.js";
|
|
2
|
+
/**
|
|
3
|
+
* Write methods allowed on contract 2, each verified against ProjectionLab
|
|
4
|
+
* 5's Plugin API. The write tools and the bridge refuse any other write
|
|
5
|
+
* method on contract 2. Contract 1 allows every write method.
|
|
6
|
+
*
|
|
7
|
+
* restoreProgress is absent: ProjectionLab 5's restoreProgress always
|
|
8
|
+
* throws, because the app records Progress history itself whenever a
|
|
9
|
+
* current value changes.
|
|
10
|
+
*/
|
|
11
|
+
export const CONTRACT_2_WRITES = new Set([
|
|
12
|
+
// ProjectionLab 5's restorePlans(plans, { key }) replaces the whole plans
|
|
13
|
+
// list, as on ProjectionLab 4: a plan missing from the array is deleted.
|
|
14
|
+
"restorePlans",
|
|
15
|
+
// updateAccount(accountId, data, { key, force }) assigns `data` over the
|
|
16
|
+
// top-level fields of `currentFinances.accounts[accountId]`, as on
|
|
17
|
+
// ProjectionLab 4. It refuses a change of `id` or `kind`, an unsupported
|
|
18
|
+
// `type`/`subtype`, and, without `force`, a field the account lacks.
|
|
19
|
+
"updateAccount",
|
|
20
|
+
// restoreCurrentFinances(currentFinances, { key }) takes every non-account
|
|
21
|
+
// field from the submission, replaces each submitted account whole, and
|
|
22
|
+
// keeps any stored account the submission leaves out: it never deletes an
|
|
23
|
+
// account. Rolling back an account change through it is exact.
|
|
24
|
+
"restoreCurrentFinances",
|
|
25
|
+
// restoreSettings(settings, { key }) replaces the whole settings document,
|
|
26
|
+
// as on ProjectionLab 4, after ProjectionLab's own validation of the
|
|
27
|
+
// document, and marks it unsaved so the app saves it.
|
|
28
|
+
"restoreSettings",
|
|
29
|
+
]);
|
|
30
|
+
/** Whether `method` may write to a page offering `contract`. */
|
|
31
|
+
export function writeSupported(contract, method) {
|
|
32
|
+
return contract !== 2 || CONTRACT_2_WRITES.has(method);
|
|
33
|
+
}
|
|
34
|
+
/** The refusal for a write method the page's contract does not offer. */
|
|
35
|
+
export function writeNotSupportedError(method) {
|
|
36
|
+
if (method === "restoreProgress") {
|
|
37
|
+
return new ProjectionLabError("WRITE_NOT_SUPPORTED", "ProjectionLab 5 removed restoreProgress", "ProjectionLab 5 records Progress history by itself whenever a current value changes, so Progress cannot be replaced. To bring back Progress from a backup file, use Restore in the ProjectionLab app. Nothing was written.");
|
|
38
|
+
}
|
|
39
|
+
return new ProjectionLabError("WRITE_NOT_SUPPORTED", `${method} is not available on ProjectionLab 5`, "Make the change in the ProjectionLab app. Nothing was written.");
|
|
40
|
+
}
|
|
41
|
+
/** The contract named by a Plugin API `version` value. */
|
|
42
|
+
export function contractFromVersion(version) {
|
|
43
|
+
if (version === undefined || version === null)
|
|
44
|
+
return 1;
|
|
45
|
+
if (version === 2)
|
|
46
|
+
return 2;
|
|
47
|
+
throw new ProjectionLabError("UNSUPPORTED_API_VERSION", `The ProjectionLab Plugin API reports contract version ${JSON.stringify(version)}, which this server does not support`, "Update projectionlab-mcp to a release that supports this ProjectionLab version. Nothing was read or written.");
|
|
48
|
+
}
|
|
49
|
+
export function layoutForContract(contract) {
|
|
50
|
+
return contract === 2 ? "v5" : "v4";
|
|
51
|
+
}
|
|
52
|
+
const isObj = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
53
|
+
/** The layout of a raw `exportData` result, from its shape. */
|
|
54
|
+
export function detectLayout(raw) {
|
|
55
|
+
return isObj(raw) && typeof raw.schema === "number" && isObj(raw.documents) ? "v5" : "v4";
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Reads an export's sections. A v5 export without a plans array is refused
|
|
59
|
+
* rather than read as "no plans", since every v5 profile has a Main Plan and
|
|
60
|
+
* an empty list would pass plan conflict checks against a real one.
|
|
61
|
+
*/
|
|
62
|
+
export function exportSections(raw) {
|
|
63
|
+
const layout = detectLayout(raw);
|
|
64
|
+
if (layout === "v5") {
|
|
65
|
+
const docs = raw.documents;
|
|
66
|
+
if (!Array.isArray(docs.plans)) {
|
|
67
|
+
throw new ProjectionLabError("UNKNOWN", "The ProjectionLab export has no plans list in documents.plans", "Reload the ProjectionLab tab and try again. If it persists, ProjectionLab's export format may have changed.");
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
layout,
|
|
71
|
+
plans: docs.plans,
|
|
72
|
+
currentFinances: docs.currentFinances,
|
|
73
|
+
settings: docs.settings,
|
|
74
|
+
progress: docs.progress,
|
|
75
|
+
accountHistory: docs.accountHistory,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
const data = isObj(raw) ? raw : {};
|
|
79
|
+
return {
|
|
80
|
+
layout,
|
|
81
|
+
plans: Array.isArray(data.plans) ? data.plans : [],
|
|
82
|
+
currentFinances: data.today,
|
|
83
|
+
settings: data.settings,
|
|
84
|
+
progress: data.progress,
|
|
85
|
+
accountHistory: undefined,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/** One named section of an export. */
|
|
89
|
+
export function sectionOf(raw, section) {
|
|
90
|
+
const sections = exportSections(raw);
|
|
91
|
+
switch (section) {
|
|
92
|
+
case "currentFinances":
|
|
93
|
+
return sections.currentFinances;
|
|
94
|
+
case "plans":
|
|
95
|
+
return sections.plans;
|
|
96
|
+
case "progress":
|
|
97
|
+
return sections.progress;
|
|
98
|
+
case "settings":
|
|
99
|
+
return sections.settings;
|
|
100
|
+
default:
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Refuses a rollback of a snapshot taken from one export layout onto an
|
|
106
|
+
* account that now exports the other. A snapshot without a recorded layout
|
|
107
|
+
* predates layout tracking and is "v4". ProjectionLab 5 has no API path for
|
|
108
|
+
* v4 data: v4 backups are restored only through the app's own Restore action
|
|
109
|
+
* (ProjectionLab Plugin API reference, restore methods).
|
|
110
|
+
*/
|
|
111
|
+
export function assertSnapshotLayout(snapshotLayout, live) {
|
|
112
|
+
const taken = snapshotLayout ?? "v4";
|
|
113
|
+
if (taken === live)
|
|
114
|
+
return;
|
|
115
|
+
throw new ProjectionLabError("LAYOUT_MISMATCH", `This snapshot was taken from ${layoutLabel(taken)}, but the account now uses ${layoutLabel(live)}`, live === "v5"
|
|
116
|
+
? "ProjectionLab 5 cannot take ProjectionLab 4 data through the Plugin API. Restore a ProjectionLab 4 backup with the Restore action in the ProjectionLab app instead. Nothing was written."
|
|
117
|
+
: "Data from ProjectionLab 5 cannot be written to a ProjectionLab 4 account. Nothing was written.");
|
|
118
|
+
}
|
|
119
|
+
export function layoutLabel(layout) {
|
|
120
|
+
return layout === "v5" ? "ProjectionLab 5" : "ProjectionLab 4";
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../src/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAoBjD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA4B,IAAI,GAAG,CAAa;IAC5E,0EAA0E;IAC1E,yEAAyE;IACzE,cAAc;IACd,yEAAyE;IACzE,mEAAmE;IACnE,yEAAyE;IACzE,qEAAqE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vB,cAAc,EAAE,SAAS;KAC1B,CAAC;AACJ,CAAC;AAED,sCAAsC;AACtC,MAAM,UAAU,SAAS,CAAC,GAAY,EAAE,OAAe;IACrD,MAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;IACrC,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,iBAAiB;YACpB,OAAO,QAAQ,CAAC,eAAe,CAAC;QAClC,KAAK,OAAO;YACV,OAAO,QAAQ,CAAC,KAAK,CAAC;QACxB,KAAK,UAAU;YACb,OAAO,QAAQ,CAAC,QAAQ,CAAC;QAC3B,KAAK,UAAU;YACb,OAAO,QAAQ,CAAC,QAAQ,CAAC;QAC3B;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,cAAwC,EAAE,IAAkB;IAC/F,MAAM,KAAK,GAAG,cAAc,IAAI,IAAI,CAAC;IACrC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO;IAC3B,MAAM,IAAI,kBAAkB,CAC1B,iBAAiB,EACjB,gCAAgC,WAAW,CAAC,KAAK,CAAC,8BAA8B,WAAW,CAAC,IAAI,CAAC,EAAE,EACnG,IAAI,KAAK,IAAI;QACX,CAAC,CAAC,0LAA0L;QAC5L,CAAC,CAAC,gGAAgG,CACrG,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,MAAoB;IAC9C,OAAO,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAC;AACjE,CAAC"}
|
package/dist/pathPatch.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ProjectionLabError } from "./errors.js";
|
|
2
|
+
import type { ExportLayout } from "./layout.js";
|
|
1
3
|
import type { PlanObj } from "./plans.js";
|
|
2
4
|
export interface AddressableValue {
|
|
3
5
|
path: string;
|
|
@@ -22,15 +24,51 @@ export interface AddressableValueOptions {
|
|
|
22
24
|
* their exact path is explicitly expanded.
|
|
23
25
|
*/
|
|
24
26
|
export declare function listAddressableValues(data: unknown, prefix?: string, options?: AddressableValueOptions): AddressableValue[];
|
|
27
|
+
/**
|
|
28
|
+
* Refusal for a field a write adds, where the container holds nothing at
|
|
29
|
+
* `path` yet: every leaf of the new value counts as changed, arrays included.
|
|
30
|
+
*/
|
|
31
|
+
export declare function enumRefusalForNewValue(scope: string, path: string, value: unknown, layout: ExportLayout): ProjectionLabError | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Whether writing `value` at `path` of `data` would change anything, compared
|
|
34
|
+
* by value rather than by JSON text. A patch leaf that already holds this
|
|
35
|
+
* value is not a write of that value, so the observed enums do not apply to
|
|
36
|
+
* it.
|
|
37
|
+
*/
|
|
38
|
+
export declare function pathValueUnchanged(data: unknown, path: string, value: unknown): boolean;
|
|
25
39
|
/**
|
|
26
40
|
* Apply path-addressed changes immutably. Paths must already exist and values
|
|
27
41
|
* must retain their JSON type. When `scope` names a group in the data model
|
|
28
42
|
* registry (a settings section, event section, or Current Finances
|
|
29
|
-
* collection), a string value outside an observed
|
|
30
|
-
* with INVALID_INPUT
|
|
43
|
+
* collection) of the `layout` data model, a string value outside an observed
|
|
44
|
+
* enum's choices is refused with INVALID_INPUT, at the addressed path and at
|
|
45
|
+
* every path nested inside a whole-object or whole-array value. A leaf is
|
|
46
|
+
* checked only when the write changes it, so an out-of-list value the stored
|
|
47
|
+
* object already holds does not block writing the fields beside it.
|
|
31
48
|
*/
|
|
32
|
-
export declare function applyExistingPathChanges(data: unknown, incoming: Record<string, unknown>, context: PathPatchContext, scope?: string): {
|
|
49
|
+
export declare function applyExistingPathChanges(data: unknown, incoming: Record<string, unknown>, context: PathPatchContext, scope?: string, layout?: ExportLayout): {
|
|
33
50
|
updated: PlanObj;
|
|
34
51
|
changes: Record<string, PathValueChange>;
|
|
35
52
|
};
|
|
53
|
+
/** A patched path whose stored value does not match what the write sent. */
|
|
54
|
+
export interface PathChangeMismatch {
|
|
55
|
+
path: string;
|
|
56
|
+
/** The value the caller asked to store. */
|
|
57
|
+
expected: unknown;
|
|
58
|
+
/** The value the plan holds now; `undefined` when the path is absent. */
|
|
59
|
+
stored: unknown;
|
|
60
|
+
/**
|
|
61
|
+
* `absent` means the path disappeared, `shape` means the stored value is a
|
|
62
|
+
* different kind of value than the one sent, and `value` means it is the
|
|
63
|
+
* right kind holding different contents.
|
|
64
|
+
*/
|
|
65
|
+
reason: "absent" | "shape" | "value";
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Report the patched paths the stored object does not carry.
|
|
69
|
+
*
|
|
70
|
+
* The reason splits the causes a boolean cannot: a path the app dropped, a
|
|
71
|
+
* value it changed the type of, and a value whose contents differ.
|
|
72
|
+
*/
|
|
73
|
+
export declare function findPathChangeMismatches(data: unknown, expected: Record<string, PathValueChange>, context: PathPatchContext): PathChangeMismatch[];
|
|
36
74
|
export declare function pathChangesApplied(data: unknown, expected: Record<string, PathValueChange>, context: PathPatchContext): boolean;
|
package/dist/pathPatch.js
CHANGED
|
@@ -2,6 +2,7 @@ import { enumRefusalError } from "./dataModel.js";
|
|
|
2
2
|
import { ProjectionLabError } from "./errors.js";
|
|
3
3
|
import { isSecretFieldName } from "./redact.js";
|
|
4
4
|
const UNSAFE_PATH_SEGMENTS = new Set(["__proto__", "prototype", "constructor"]);
|
|
5
|
+
const ABSENT = { present: false };
|
|
5
6
|
function valueType(value) {
|
|
6
7
|
if (value === null)
|
|
7
8
|
return "null";
|
|
@@ -131,14 +132,91 @@ function replaceAtPath(root, parts, incoming, fullPath, context) {
|
|
|
131
132
|
[head]: replacement,
|
|
132
133
|
};
|
|
133
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* The value stored at a dot path. Reading a path never fails: an unknown path
|
|
137
|
+
* is `ABSENT`, so everything written under it counts as changed, and
|
|
138
|
+
* `replaceAtPath` is what refuses it.
|
|
139
|
+
*/
|
|
140
|
+
function readStoredPath(data, parts) {
|
|
141
|
+
let current = data;
|
|
142
|
+
for (const part of parts) {
|
|
143
|
+
if (!isContainer(current) ||
|
|
144
|
+
!Object.prototype.hasOwnProperty.call(current, part)) {
|
|
145
|
+
return ABSENT;
|
|
146
|
+
}
|
|
147
|
+
current = containerValue(current, part);
|
|
148
|
+
}
|
|
149
|
+
return { present: true, value: current };
|
|
150
|
+
}
|
|
151
|
+
/** The stored counterpart of one key inside a compared value. */
|
|
152
|
+
function storedCounterpart(stored, key) {
|
|
153
|
+
if (!stored.present || !isContainer(stored.value))
|
|
154
|
+
return ABSENT;
|
|
155
|
+
if (!Object.prototype.hasOwnProperty.call(stored.value, key))
|
|
156
|
+
return ABSENT;
|
|
157
|
+
return { present: true, value: containerValue(stored.value, key) };
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Refusal for a value a write sets outside an observed enum's choices, where
|
|
161
|
+
* `stored` is what the container holds at the same joined path. A whole object
|
|
162
|
+
* or array is walked and each leaf is compared, so `yearlyChange.type` is
|
|
163
|
+
* enforced whether the caller addressed that leaf or sent the container around
|
|
164
|
+
* it. Array elements are addressed by numeric index, the syntax `parsePath`
|
|
165
|
+
* accepts and the registry wildcards match, so a `criteria.*.type` entry
|
|
166
|
+
* matches `criteria.0.type`.
|
|
167
|
+
*
|
|
168
|
+
* Only a leaf whose value the write actually changes is refused. A whole-object
|
|
169
|
+
* write carries the sibling values it did not come to change, so an out-of-list
|
|
170
|
+
* value the plan already holds rides through untouched while the field the
|
|
171
|
+
* caller came for is written; moving that same value to another out-of-list
|
|
172
|
+
* value is still refused. A leaf with no stored counterpart (a new key, an
|
|
173
|
+
* element past the end of the stored array, a stored value of another kind)
|
|
174
|
+
* counts as changed and is checked.
|
|
175
|
+
*/
|
|
176
|
+
function enumRefusalForValue(scope, path, value, stored, layout) {
|
|
177
|
+
if (stored.present && storedValueMatches(value, stored.value)) {
|
|
178
|
+
return undefined;
|
|
179
|
+
}
|
|
180
|
+
const refusal = enumRefusalError(scope, path, value, layout);
|
|
181
|
+
if (refusal)
|
|
182
|
+
return refusal;
|
|
183
|
+
if (!isContainer(value))
|
|
184
|
+
return undefined;
|
|
185
|
+
for (const key of Object.keys(value)) {
|
|
186
|
+
const nested = enumRefusalForValue(scope, `${path}.${key}`, containerValue(value, key), storedCounterpart(stored, key), layout);
|
|
187
|
+
if (nested)
|
|
188
|
+
return nested;
|
|
189
|
+
}
|
|
190
|
+
return undefined;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Refusal for a field a write adds, where the container holds nothing at
|
|
194
|
+
* `path` yet: every leaf of the new value counts as changed, arrays included.
|
|
195
|
+
*/
|
|
196
|
+
export function enumRefusalForNewValue(scope, path, value, layout) {
|
|
197
|
+
return enumRefusalForValue(scope, path, value, ABSENT, layout);
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Whether writing `value` at `path` of `data` would change anything, compared
|
|
201
|
+
* by value rather than by JSON text. A patch leaf that already holds this
|
|
202
|
+
* value is not a write of that value, so the observed enums do not apply to
|
|
203
|
+
* it.
|
|
204
|
+
*/
|
|
205
|
+
export function pathValueUnchanged(data, path, value) {
|
|
206
|
+
const stored = readStoredPath(data, path.split("."));
|
|
207
|
+
return stored.present && storedValueMatches(value, stored.value);
|
|
208
|
+
}
|
|
134
209
|
/**
|
|
135
210
|
* Apply path-addressed changes immutably. Paths must already exist and values
|
|
136
211
|
* must retain their JSON type. When `scope` names a group in the data model
|
|
137
212
|
* registry (a settings section, event section, or Current Finances
|
|
138
|
-
* collection), a string value outside an observed
|
|
139
|
-
* with INVALID_INPUT
|
|
213
|
+
* collection) of the `layout` data model, a string value outside an observed
|
|
214
|
+
* enum's choices is refused with INVALID_INPUT, at the addressed path and at
|
|
215
|
+
* every path nested inside a whole-object or whole-array value. A leaf is
|
|
216
|
+
* checked only when the write changes it, so an out-of-list value the stored
|
|
217
|
+
* object already holds does not block writing the fields beside it.
|
|
140
218
|
*/
|
|
141
|
-
export function applyExistingPathChanges(data, incoming, context, scope) {
|
|
219
|
+
export function applyExistingPathChanges(data, incoming, context, scope, layout = "v4") {
|
|
142
220
|
if (!isPlainObject(data)) {
|
|
143
221
|
throw new ProjectionLabError("INVALID_INPUT", `The selected ${context.label} container is not an object`, `Inspect it with ${context.discoveryTool}`);
|
|
144
222
|
}
|
|
@@ -153,15 +231,21 @@ export function applyExistingPathChanges(data, incoming, context, scope) {
|
|
|
153
231
|
throw new ProjectionLabError("INVALID_INPUT", `Overlapping ${context.label} paths "${parent}" and "${child}"`, "Change either the parent value or its nested paths in one request, not both");
|
|
154
232
|
}
|
|
155
233
|
}
|
|
156
|
-
|
|
157
|
-
|
|
234
|
+
// Every refusal is raised before anything is applied, so a later path cannot
|
|
235
|
+
// leave a half-patched container.
|
|
236
|
+
const checked = [];
|
|
158
237
|
for (const [path, after] of Object.entries(incoming)) {
|
|
159
238
|
const parts = parsePath(path, context);
|
|
160
239
|
if (scope !== undefined) {
|
|
161
|
-
const refusal =
|
|
240
|
+
const refusal = enumRefusalForValue(scope, path, after, readStoredPath(data, parts), layout);
|
|
162
241
|
if (refusal)
|
|
163
242
|
throw refusal;
|
|
164
243
|
}
|
|
244
|
+
checked.push({ path, parts, after });
|
|
245
|
+
}
|
|
246
|
+
let updated = data;
|
|
247
|
+
const changes = {};
|
|
248
|
+
for (const { path, parts, after } of checked) {
|
|
165
249
|
let before = data;
|
|
166
250
|
for (const part of parts) {
|
|
167
251
|
if (!isContainer(before) ||
|
|
@@ -177,21 +261,85 @@ export function applyExistingPathChanges(data, incoming, context, scope) {
|
|
|
177
261
|
}
|
|
178
262
|
return { updated, changes };
|
|
179
263
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
264
|
+
/**
|
|
265
|
+
* Match a stored value against the value a write submitted.
|
|
266
|
+
*
|
|
267
|
+
* ProjectionLab rewrites objects as it saves them: it emits keys in its own
|
|
268
|
+
* order and fills in defaults the caller never sent. Comparing JSON text
|
|
269
|
+
* therefore rejects writes that did land, so every key and array element the
|
|
270
|
+
* caller sent must be stored with an equal value while keys the app adds on
|
|
271
|
+
* its own are allowed. A key that vanishes, changes type or changes value
|
|
272
|
+
* still fails.
|
|
273
|
+
*/
|
|
274
|
+
function storedValueMatches(expected, stored) {
|
|
275
|
+
if (isPlainObject(expected)) {
|
|
276
|
+
if (!isPlainObject(stored))
|
|
277
|
+
return false;
|
|
278
|
+
return Object.entries(expected).every(([key, value]) => Object.prototype.hasOwnProperty.call(stored, key) &&
|
|
279
|
+
storedValueMatches(value, stored[key]));
|
|
280
|
+
}
|
|
281
|
+
if (Array.isArray(expected)) {
|
|
282
|
+
return (Array.isArray(stored) &&
|
|
283
|
+
stored.length === expected.length &&
|
|
284
|
+
expected.every((item, index) => storedValueMatches(item, stored[index])));
|
|
285
|
+
}
|
|
286
|
+
return expected === stored;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Report the patched paths the stored object does not carry.
|
|
290
|
+
*
|
|
291
|
+
* The reason splits the causes a boolean cannot: a path the app dropped, a
|
|
292
|
+
* value it changed the type of, and a value whose contents differ.
|
|
293
|
+
*/
|
|
294
|
+
export function findPathChangeMismatches(data, expected, context) {
|
|
295
|
+
const entries = Object.entries(expected);
|
|
296
|
+
if (!isPlainObject(data)) {
|
|
297
|
+
return entries.map(([path, change]) => ({
|
|
298
|
+
path,
|
|
299
|
+
expected: change.after,
|
|
300
|
+
stored: undefined,
|
|
301
|
+
reason: "absent",
|
|
302
|
+
}));
|
|
303
|
+
}
|
|
304
|
+
const mismatches = [];
|
|
305
|
+
for (const [path, change] of entries) {
|
|
184
306
|
let actual = data;
|
|
307
|
+
let present = true;
|
|
185
308
|
for (const part of parsePath(path, context)) {
|
|
186
309
|
if (!isContainer(actual) ||
|
|
187
310
|
!Object.prototype.hasOwnProperty.call(actual, part)) {
|
|
188
|
-
|
|
311
|
+
present = false;
|
|
312
|
+
break;
|
|
189
313
|
}
|
|
190
314
|
actual = containerValue(actual, part);
|
|
191
315
|
}
|
|
192
|
-
if (
|
|
193
|
-
|
|
316
|
+
if (!present) {
|
|
317
|
+
mismatches.push({
|
|
318
|
+
path,
|
|
319
|
+
expected: change.after,
|
|
320
|
+
stored: undefined,
|
|
321
|
+
reason: "absent",
|
|
322
|
+
});
|
|
323
|
+
continue;
|
|
324
|
+
}
|
|
325
|
+
if (storedValueMatches(change.after, actual))
|
|
326
|
+
continue;
|
|
327
|
+
const sameKind = Array.isArray(change.after) === Array.isArray(actual) &&
|
|
328
|
+
change.after !== null &&
|
|
329
|
+
actual !== null &&
|
|
330
|
+
typeof change.after === typeof actual;
|
|
331
|
+
mismatches.push({
|
|
332
|
+
path,
|
|
333
|
+
expected: change.after,
|
|
334
|
+
stored: actual,
|
|
335
|
+
reason: sameKind ? "value" : "shape",
|
|
336
|
+
});
|
|
194
337
|
}
|
|
195
|
-
return
|
|
338
|
+
return mismatches;
|
|
339
|
+
}
|
|
340
|
+
export function pathChangesApplied(data, expected, context) {
|
|
341
|
+
if (!isPlainObject(data))
|
|
342
|
+
return false;
|
|
343
|
+
return findPathChangeMismatches(data, expected, context).length === 0;
|
|
196
344
|
}
|
|
197
345
|
//# sourceMappingURL=pathPatch.js.map
|
package/dist/pathPatch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pathPatch.js","sourceRoot":"","sources":["../src/pathPatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAwBhD,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC;AAEhF,SAAS,SAAS,CAAC,KAAc;IAC/B,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC;IAClC,IAAI,KAAK,CAAC,OAAO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AAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;AACxE,CAAC"}
|
package/dist/planSettings.d.ts
CHANGED
|
@@ -1,11 +1,30 @@
|
|
|
1
|
+
import { type ExportLayout } from "./layout.js";
|
|
1
2
|
import { type AddressableValue, type PathValueChange } from "./pathPatch.js";
|
|
2
3
|
export declare const PLAN_SETTING_SECTIONS: readonly ["variables", "montecarlo", "withdrawalStrategy"];
|
|
3
4
|
export type PlanSettingSection = (typeof PLAN_SETTING_SECTIONS)[number];
|
|
4
5
|
export type PlanSetting = AddressableValue;
|
|
5
6
|
export type PlanSettingChange = PathValueChange;
|
|
7
|
+
export declare const PLAN_SETTING_CONTEXT: {
|
|
8
|
+
readonly label: "plan setting";
|
|
9
|
+
readonly discoveryTool: "projectionlab_get_plan_settings";
|
|
10
|
+
readonly example: "{ \"inflation\": 3 }";
|
|
11
|
+
};
|
|
6
12
|
export declare function listPlanSettings(sectionData: unknown, section?: PlanSettingSection): PlanSetting[];
|
|
7
|
-
export declare function applyPlanSettingChanges(sectionData: unknown, incoming: Record<string, unknown>, section?: PlanSettingSection): {
|
|
13
|
+
export declare function applyPlanSettingChanges(sectionData: unknown, incoming: Record<string, unknown>, section?: PlanSettingSection, layout?: ExportLayout): {
|
|
8
14
|
updated: Record<string, unknown>;
|
|
9
15
|
changes: Record<string, PlanSettingChange>;
|
|
10
16
|
};
|
|
11
|
-
|
|
17
|
+
/** Workspace plan settings as a ProjectionLab 5 export holds them. */
|
|
18
|
+
export interface PlanSelection {
|
|
19
|
+
activeId: unknown;
|
|
20
|
+
baselineId: unknown;
|
|
21
|
+
alignment: unknown;
|
|
22
|
+
tabs: unknown;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The workspace-level plan settings of a ProjectionLab 5 export
|
|
26
|
+
* (`documents.settings.plan`), or null for a ProjectionLab 4 export, whose
|
|
27
|
+
* plans carry their own flags. A value the export leaves unset or null is
|
|
28
|
+
* NOT_REPORTED; no plan is ever picked as the active or baseline one here.
|
|
29
|
+
*/
|
|
30
|
+
export declare function planSelection(raw: unknown): PlanSelection | null;
|
package/dist/planSettings.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { exportSections } from "./layout.js";
|
|
2
|
+
import { applyExistingPathChanges, listAddressableValues, } from "./pathPatch.js";
|
|
3
|
+
import { NOT_REPORTED } from "./plans.js";
|
|
2
4
|
export const PLAN_SETTING_SECTIONS = [
|
|
3
5
|
"variables",
|
|
4
6
|
"montecarlo",
|
|
@@ -11,7 +13,7 @@ const ADVANCED_RATE_SCHEDULES = new Set([
|
|
|
11
13
|
"bondInvestmentReturnCustom",
|
|
12
14
|
"bondDividendRateCustom",
|
|
13
15
|
]);
|
|
14
|
-
const PLAN_SETTING_CONTEXT = {
|
|
16
|
+
export const PLAN_SETTING_CONTEXT = {
|
|
15
17
|
label: "plan setting",
|
|
16
18
|
discoveryTool: "projectionlab_get_plan_settings",
|
|
17
19
|
example: '{ "inflation": 3 }',
|
|
@@ -21,10 +23,32 @@ export function listPlanSettings(sectionData, section) {
|
|
|
21
23
|
? { expandArrayPaths: ADVANCED_RATE_SCHEDULES }
|
|
22
24
|
: {});
|
|
23
25
|
}
|
|
24
|
-
export function applyPlanSettingChanges(sectionData, incoming, section) {
|
|
25
|
-
return applyExistingPathChanges(sectionData, incoming, PLAN_SETTING_CONTEXT, section);
|
|
26
|
+
export function applyPlanSettingChanges(sectionData, incoming, section, layout = "v4") {
|
|
27
|
+
return applyExistingPathChanges(sectionData, incoming, PLAN_SETTING_CONTEXT, section, layout);
|
|
26
28
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
/**
|
|
30
|
+
* The workspace-level plan settings of a ProjectionLab 5 export
|
|
31
|
+
* (`documents.settings.plan`), or null for a ProjectionLab 4 export, whose
|
|
32
|
+
* plans carry their own flags. A value the export leaves unset or null is
|
|
33
|
+
* NOT_REPORTED; no plan is ever picked as the active or baseline one here.
|
|
34
|
+
*/
|
|
35
|
+
export function planSelection(raw) {
|
|
36
|
+
const sections = exportSections(raw);
|
|
37
|
+
if (sections.layout !== "v5")
|
|
38
|
+
return null;
|
|
39
|
+
const settings = sections.settings;
|
|
40
|
+
const held = settings && typeof settings === "object"
|
|
41
|
+
? settings.plan
|
|
42
|
+
: undefined;
|
|
43
|
+
const plan = held && typeof held === "object" && !Array.isArray(held)
|
|
44
|
+
? held
|
|
45
|
+
: {};
|
|
46
|
+
const reported = (value) => value === undefined || value === null ? NOT_REPORTED : value;
|
|
47
|
+
return {
|
|
48
|
+
activeId: reported(plan.activeId),
|
|
49
|
+
baselineId: reported(plan.baselineId),
|
|
50
|
+
alignment: reported(plan.alignment),
|
|
51
|
+
tabs: reported(plan.tabs),
|
|
52
|
+
};
|
|
29
53
|
}
|
|
30
54
|
//# sourceMappingURL=planSettings.js.map
|
package/dist/planSettings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planSettings.js","sourceRoot":"","sources":["../src/planSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"planSettings.js","sourceRoot":"","sources":["../src/planSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqB,MAAM,aAAa,CAAC;AAChE,OAAO,EACL,wBAAwB,EACxB,qBAAqB,GAGtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAgB,MAAM,YAAY,CAAC;AAExD,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,WAAW;IACX,YAAY;IACZ,oBAAoB;CACZ,CAAC;AAMX,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAC;IACtC,iBAAiB;IACjB,wBAAwB;IACxB,oBAAoB;IACpB,4BAA4B;IAC5B,wBAAwB;CACzB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,KAAK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,CAAC;QACjC,UAAU,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC;QACrC,SAAS,EAAE,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;QACnC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;KAC1B,CAAC;AACJ,CAAC"}
|
package/dist/planVersion.d.ts
CHANGED
|
@@ -6,8 +6,13 @@ import { ProjectionLabError } from "./errors.js";
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function planVersion(plan: unknown): string | undefined;
|
|
8
8
|
/**
|
|
9
|
-
* Describe how `current` differs from `read`: plans added, removed, or
|
|
10
|
-
* since `read` was taken. Empty when nothing changed.
|
|
9
|
+
* Describe how `current` differs from `read`: plans added, removed, saved, or
|
|
10
|
+
* changed since `read` was taken. Empty when nothing changed.
|
|
11
|
+
*
|
|
12
|
+
* A plan's `lastUpdated` stamp decides when both reads carry one;
|
|
13
|
+
* ProjectionLab moves it each time it saves the plan. A plan with no stamp
|
|
14
|
+
* on either read has no version to compare, so its input content is compared
|
|
15
|
+
* in both directions instead (computed fields left out, see samePlanContent).
|
|
11
16
|
*/
|
|
12
17
|
export declare function planChanges(read: unknown[], current: unknown[]): string[];
|
|
13
18
|
export declare function planConflictError(changes: string[]): ProjectionLabError;
|