@uwmd/core 1.1.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.
Files changed (214) hide show
  1. package/README.md +79 -0
  2. package/dist/agents/bancroft.d.ts +32 -0
  3. package/dist/agents/bancroft.d.ts.map +1 -0
  4. package/dist/agents/bancroft.js +292 -0
  5. package/dist/agents/bancroft.js.map +1 -0
  6. package/dist/agents/schemas.d.ts +13 -0
  7. package/dist/agents/schemas.d.ts.map +1 -0
  8. package/dist/agents/schemas.js +74 -0
  9. package/dist/agents/schemas.js.map +1 -0
  10. package/dist/bindings.d.ts +85 -0
  11. package/dist/bindings.d.ts.map +1 -0
  12. package/dist/bindings.js +293 -0
  13. package/dist/bindings.js.map +1 -0
  14. package/dist/browser.d.ts +66 -0
  15. package/dist/browser.d.ts.map +1 -0
  16. package/dist/browser.js +53 -0
  17. package/dist/browser.js.map +1 -0
  18. package/dist/calc/builtins.d.ts +4 -0
  19. package/dist/calc/builtins.d.ts.map +1 -0
  20. package/dist/calc/builtins.js +329 -0
  21. package/dist/calc/builtins.js.map +1 -0
  22. package/dist/calc/dependencies.d.ts +34 -0
  23. package/dist/calc/dependencies.d.ts.map +1 -0
  24. package/dist/calc/dependencies.js +101 -0
  25. package/dist/calc/dependencies.js.map +1 -0
  26. package/dist/calc/errors.d.ts +8 -0
  27. package/dist/calc/errors.d.ts.map +1 -0
  28. package/dist/calc/errors.js +18 -0
  29. package/dist/calc/errors.js.map +1 -0
  30. package/dist/calc/evaluator.d.ts +5 -0
  31. package/dist/calc/evaluator.d.ts.map +1 -0
  32. package/dist/calc/evaluator.js +184 -0
  33. package/dist/calc/evaluator.js.map +1 -0
  34. package/dist/calc/index.d.ts +14 -0
  35. package/dist/calc/index.d.ts.map +1 -0
  36. package/dist/calc/index.js +56 -0
  37. package/dist/calc/index.js.map +1 -0
  38. package/dist/calc/parser.d.ts +32 -0
  39. package/dist/calc/parser.d.ts.map +1 -0
  40. package/dist/calc/parser.js +361 -0
  41. package/dist/calc/parser.js.map +1 -0
  42. package/dist/cascade.d.ts +85 -0
  43. package/dist/cascade.d.ts.map +1 -0
  44. package/dist/cascade.js +172 -0
  45. package/dist/cascade.js.map +1 -0
  46. package/dist/cli.d.ts +3 -0
  47. package/dist/cli.d.ts.map +1 -0
  48. package/dist/cli.js +843 -0
  49. package/dist/cli.js.map +1 -0
  50. package/dist/codec.d.ts +25 -0
  51. package/dist/codec.d.ts.map +1 -0
  52. package/dist/codec.js +62 -0
  53. package/dist/codec.js.map +1 -0
  54. package/dist/codecs.d.ts +6 -0
  55. package/dist/codecs.d.ts.map +1 -0
  56. package/dist/codecs.js +12 -0
  57. package/dist/codecs.js.map +1 -0
  58. package/dist/compactor.d.ts +11 -0
  59. package/dist/compactor.d.ts.map +1 -0
  60. package/dist/compactor.js +84 -0
  61. package/dist/compactor.js.map +1 -0
  62. package/dist/context-profiles.d.ts +30 -0
  63. package/dist/context-profiles.d.ts.map +1 -0
  64. package/dist/context-profiles.js +225 -0
  65. package/dist/context-profiles.js.map +1 -0
  66. package/dist/context.d.ts +55 -0
  67. package/dist/context.d.ts.map +1 -0
  68. package/dist/context.js +288 -0
  69. package/dist/context.js.map +1 -0
  70. package/dist/dcf.d.ts +9 -0
  71. package/dist/dcf.d.ts.map +1 -0
  72. package/dist/dcf.js +75 -0
  73. package/dist/dcf.js.map +1 -0
  74. package/dist/debt.d.ts +11 -0
  75. package/dist/debt.d.ts.map +1 -0
  76. package/dist/debt.js +85 -0
  77. package/dist/debt.js.map +1 -0
  78. package/dist/defaults.d.ts +104 -0
  79. package/dist/defaults.d.ts.map +1 -0
  80. package/dist/defaults.js +622 -0
  81. package/dist/defaults.js.map +1 -0
  82. package/dist/derived.d.ts +17 -0
  83. package/dist/derived.d.ts.map +1 -0
  84. package/dist/derived.js +29 -0
  85. package/dist/derived.js.map +1 -0
  86. package/dist/editor.d.ts +76 -0
  87. package/dist/editor.d.ts.map +1 -0
  88. package/dist/editor.js +502 -0
  89. package/dist/editor.js.map +1 -0
  90. package/dist/envelope.d.ts +51 -0
  91. package/dist/envelope.d.ts.map +1 -0
  92. package/dist/envelope.js +213 -0
  93. package/dist/envelope.js.map +1 -0
  94. package/dist/format.d.ts +60 -0
  95. package/dist/format.d.ts.map +1 -0
  96. package/dist/format.js +115 -0
  97. package/dist/format.js.map +1 -0
  98. package/dist/gaps.d.ts +62 -0
  99. package/dist/gaps.d.ts.map +1 -0
  100. package/dist/gaps.js +272 -0
  101. package/dist/gaps.js.map +1 -0
  102. package/dist/index.d.ts +75 -0
  103. package/dist/index.d.ts.map +1 -0
  104. package/dist/index.js +47 -0
  105. package/dist/index.js.map +1 -0
  106. package/dist/init.d.ts +15 -0
  107. package/dist/init.d.ts.map +1 -0
  108. package/dist/init.js +169 -0
  109. package/dist/init.js.map +1 -0
  110. package/dist/integrity-canonical.d.ts +17 -0
  111. package/dist/integrity-canonical.d.ts.map +1 -0
  112. package/dist/integrity-canonical.js +124 -0
  113. package/dist/integrity-canonical.js.map +1 -0
  114. package/dist/integrity.d.ts +54 -0
  115. package/dist/integrity.d.ts.map +1 -0
  116. package/dist/integrity.js +244 -0
  117. package/dist/integrity.js.map +1 -0
  118. package/dist/modules.d.ts +24 -0
  119. package/dist/modules.d.ts.map +1 -0
  120. package/dist/modules.js +322 -0
  121. package/dist/modules.js.map +1 -0
  122. package/dist/negotiation.d.ts +19 -0
  123. package/dist/negotiation.d.ts.map +1 -0
  124. package/dist/negotiation.js +70 -0
  125. package/dist/negotiation.js.map +1 -0
  126. package/dist/opstatement.d.ts +9 -0
  127. package/dist/opstatement.d.ts.map +1 -0
  128. package/dist/opstatement.js +80 -0
  129. package/dist/opstatement.js.map +1 -0
  130. package/dist/packs/excel-emit.d.ts +21 -0
  131. package/dist/packs/excel-emit.d.ts.map +1 -0
  132. package/dist/packs/excel-emit.js +135 -0
  133. package/dist/packs/excel-emit.js.map +1 -0
  134. package/dist/packs/index.d.ts +13 -0
  135. package/dist/packs/index.d.ts.map +1 -0
  136. package/dist/packs/index.js +37 -0
  137. package/dist/packs/index.js.map +1 -0
  138. package/dist/packs/industrial.d.ts +3 -0
  139. package/dist/packs/industrial.d.ts.map +1 -0
  140. package/dist/packs/industrial.js +115 -0
  141. package/dist/packs/industrial.js.map +1 -0
  142. package/dist/packs/multifamily.d.ts +3 -0
  143. package/dist/packs/multifamily.d.ts.map +1 -0
  144. package/dist/packs/multifamily.js +82 -0
  145. package/dist/packs/multifamily.js.map +1 -0
  146. package/dist/packs/office.d.ts +3 -0
  147. package/dist/packs/office.d.ts.map +1 -0
  148. package/dist/packs/office.js +108 -0
  149. package/dist/packs/office.js.map +1 -0
  150. package/dist/packs/retail.d.ts +3 -0
  151. package/dist/packs/retail.d.ts.map +1 -0
  152. package/dist/packs/retail.js +115 -0
  153. package/dist/packs/retail.js.map +1 -0
  154. package/dist/packs/self-storage.d.ts +3 -0
  155. package/dist/packs/self-storage.d.ts.map +1 -0
  156. package/dist/packs/self-storage.js +105 -0
  157. package/dist/packs/self-storage.js.map +1 -0
  158. package/dist/parser.d.ts +15 -0
  159. package/dist/parser.d.ts.map +1 -0
  160. package/dist/parser.js +430 -0
  161. package/dist/parser.js.map +1 -0
  162. package/dist/protocol.d.ts +389 -0
  163. package/dist/protocol.d.ts.map +1 -0
  164. package/dist/protocol.js +714 -0
  165. package/dist/protocol.js.map +1 -0
  166. package/dist/refinement.d.ts +63 -0
  167. package/dist/refinement.d.ts.map +1 -0
  168. package/dist/refinement.js +242 -0
  169. package/dist/refinement.js.map +1 -0
  170. package/dist/renderer.d.ts +22 -0
  171. package/dist/renderer.d.ts.map +1 -0
  172. package/dist/renderer.js +478 -0
  173. package/dist/renderer.js.map +1 -0
  174. package/dist/rentroll.d.ts +21 -0
  175. package/dist/rentroll.d.ts.map +1 -0
  176. package/dist/rentroll.js +256 -0
  177. package/dist/rentroll.js.map +1 -0
  178. package/dist/report.d.ts +29 -0
  179. package/dist/report.d.ts.map +1 -0
  180. package/dist/report.js +924 -0
  181. package/dist/report.js.map +1 -0
  182. package/dist/runner.d.ts +43 -0
  183. package/dist/runner.d.ts.map +1 -0
  184. package/dist/runner.js +288 -0
  185. package/dist/runner.js.map +1 -0
  186. package/dist/sourcesuses.d.ts +14 -0
  187. package/dist/sourcesuses.d.ts.map +1 -0
  188. package/dist/sourcesuses.js +63 -0
  189. package/dist/sourcesuses.js.map +1 -0
  190. package/dist/types.d.ts +248 -0
  191. package/dist/types.d.ts.map +1 -0
  192. package/dist/types.js +15 -0
  193. package/dist/types.js.map +1 -0
  194. package/dist/uwcsv.d.ts +23 -0
  195. package/dist/uwcsv.d.ts.map +1 -0
  196. package/dist/uwcsv.js +877 -0
  197. package/dist/uwcsv.js.map +1 -0
  198. package/dist/uwjson.d.ts +19 -0
  199. package/dist/uwjson.d.ts.map +1 -0
  200. package/dist/uwjson.js +61 -0
  201. package/dist/uwjson.js.map +1 -0
  202. package/dist/uwxml.d.ts +18 -0
  203. package/dist/uwxml.d.ts.map +1 -0
  204. package/dist/uwxml.js +297 -0
  205. package/dist/uwxml.js.map +1 -0
  206. package/dist/validator.d.ts +35 -0
  207. package/dist/validator.d.ts.map +1 -0
  208. package/dist/validator.js +553 -0
  209. package/dist/validator.js.map +1 -0
  210. package/dist/valuation.d.ts +9 -0
  211. package/dist/valuation.d.ts.map +1 -0
  212. package/dist/valuation.js +34 -0
  213. package/dist/valuation.js.map +1 -0
  214. package/package.json +58 -0
package/dist/gaps.js ADDED
@@ -0,0 +1,272 @@
1
+ // Gaps inference + summarization — Format Spec §4.22
2
+ //
3
+ // A "gap" is an open data deficiency that may block stage advancement or
4
+ // carry a provisional default. This module:
5
+ // - Walks the parsed file looking for missing-required, partial, or
6
+ // provisional state and emits a normalized GapItem per finding.
7
+ // - Merges with an existing `gaps` section (deduping by section + path).
8
+ // - Summarizes the resulting list relative to a current stage.
9
+ import { STAGE_REQUIREMENTS } from './validator.js';
10
+ import { deepGet, getSection } from './parser.js';
11
+ // ─── Stage helpers ───────────────────────────────────────────────────────────
12
+ const STAGE_ORDER = [
13
+ 'scope',
14
+ 'screening',
15
+ 'term_sheet',
16
+ 'full_underwrite',
17
+ 'credit_approval',
18
+ 'closing',
19
+ 'monitoring',
20
+ ];
21
+ function nextStage(stage) {
22
+ const idx = STAGE_ORDER.indexOf(stage);
23
+ if (idx === -1 || idx === STAGE_ORDER.length - 1)
24
+ return null;
25
+ return STAGE_ORDER[idx + 1];
26
+ }
27
+ function blocksAtOrBefore(item, stage) {
28
+ if (!item.blocks_stage)
29
+ return false;
30
+ const itemIdx = STAGE_ORDER.indexOf(item.blocks_stage);
31
+ const stageIdx = STAGE_ORDER.indexOf(stage);
32
+ return itemIdx !== -1 && stageIdx !== -1 && itemIdx <= stageIdx;
33
+ }
34
+ function blockOf(parsed, sectionId) {
35
+ const entry = parsed.sections[sectionId];
36
+ if (!entry)
37
+ return null;
38
+ if ('annotation' in entry)
39
+ return entry;
40
+ // Multi-variant sections: take the first variant for inference purposes.
41
+ // Variant-specific gap inference is left to RFC 0009.
42
+ const variants = Object.values(entry);
43
+ return variants[0] ?? null;
44
+ }
45
+ function pathExistsInSection(parsed, sectionId, rest) {
46
+ const block = blockOf(parsed, sectionId);
47
+ if (!block)
48
+ return false;
49
+ return deepGet(block.content, rest) !== undefined;
50
+ }
51
+ function splitFieldPath(field_path) {
52
+ const dot = field_path.indexOf('.');
53
+ if (dot === -1)
54
+ return null;
55
+ return { sectionId: field_path.slice(0, dot), rest: field_path.slice(dot + 1) };
56
+ }
57
+ function findStageThatRequires(field_path, currentStage) {
58
+ const split = splitFieldPath(field_path);
59
+ for (const stage of STAGE_ORDER) {
60
+ const req = STAGE_REQUIREMENTS[stage];
61
+ if (req.required_field_paths?.includes(field_path))
62
+ return stage;
63
+ // If a section is required but the field is inside it, attribute to that stage.
64
+ if (split && req.required_sections.includes(split.sectionId))
65
+ return stage;
66
+ }
67
+ return currentStage;
68
+ }
69
+ /**
70
+ * Walk the parsed file and produce a normalized list of GapItems by inspecting:
71
+ * - STAGE_REQUIREMENTS: required sections / field paths missing at the
72
+ * evaluated stage produce reason='missing'.
73
+ * - `_meta.provisional`: produces reason='deferred' (placeholder block).
74
+ * - `_meta.partial`: produces reason='missing' for the section as a whole,
75
+ * unless `field_overrides` enumerate specific paths (then one item per
76
+ * override with `reason='illegible'` for illegible, else 'missing').
77
+ * - `_meta.field_overrides[]` with reason='missing'|'illegible': one
78
+ * GapItem per entry.
79
+ *
80
+ * When `mergeWithExisting` is set, the existing `gaps` section is read and
81
+ * merged. Existing items win on dedup (their `first_seen`, `owner`, `note`
82
+ * are preserved); the inferrer only refreshes `last_checked`.
83
+ */
84
+ export function inferGaps(parsed, opts = {}) {
85
+ const stage = opts.stage ?? parsed.frontmatter.deal_stage ?? 'scope';
86
+ const now = opts.now ?? new Date().toISOString();
87
+ const owner = opts.unattributed ? undefined : 'agent/gaps-inferrer';
88
+ const inferred = [];
89
+ const seen = new Set();
90
+ const keyOf = (sectionId, fieldPath) => `${sectionId}::${fieldPath ?? ''}`;
91
+ const push = (item) => {
92
+ const k = keyOf(item.section, item.field_path);
93
+ if (seen.has(k))
94
+ return;
95
+ seen.add(k);
96
+ inferred.push(item);
97
+ };
98
+ // 1) Stage-required sections that are absent
99
+ const req = STAGE_REQUIREMENTS[stage];
100
+ for (const sectionId of req.required_sections) {
101
+ if (!parsed.sections[sectionId]) {
102
+ push({
103
+ section: sectionId,
104
+ reason: 'missing',
105
+ blocks_stage: stage,
106
+ first_seen: now,
107
+ last_checked: now,
108
+ owner,
109
+ note: `Required section for stage '${stage}' is absent.`,
110
+ });
111
+ }
112
+ }
113
+ // 2) Stage-required field paths that are absent
114
+ if (req.required_field_paths) {
115
+ for (const fp of req.required_field_paths) {
116
+ const split = splitFieldPath(fp);
117
+ if (!split)
118
+ continue;
119
+ if (!pathExistsInSection(parsed, split.sectionId, split.rest)) {
120
+ push({
121
+ section: split.sectionId,
122
+ field_path: split.rest,
123
+ reason: 'missing',
124
+ blocks_stage: stage,
125
+ first_seen: now,
126
+ last_checked: now,
127
+ owner,
128
+ note: `Required field for stage '${stage}'.`,
129
+ });
130
+ }
131
+ }
132
+ }
133
+ // 3) required_one_of: at least one path of each group must exist
134
+ if (req.required_one_of) {
135
+ for (const group of req.required_one_of) {
136
+ const anyPresent = group.some((fp) => {
137
+ const split = splitFieldPath(fp);
138
+ if (!split)
139
+ return false;
140
+ return pathExistsInSection(parsed, split.sectionId, split.rest);
141
+ });
142
+ if (!anyPresent) {
143
+ const first = splitFieldPath(group[0]);
144
+ if (first) {
145
+ push({
146
+ section: first.sectionId,
147
+ field_path: first.rest,
148
+ reason: 'missing',
149
+ blocks_stage: stage,
150
+ first_seen: now,
151
+ last_checked: now,
152
+ owner,
153
+ note: `One of [${group.join(', ')}] required for stage '${stage}'.`,
154
+ });
155
+ }
156
+ }
157
+ }
158
+ }
159
+ // 4) Walk every present section's _meta
160
+ for (const sectionId of Object.keys(parsed.sections)) {
161
+ const block = blockOf(parsed, sectionId);
162
+ if (!block)
163
+ continue;
164
+ const m = block.meta;
165
+ if (m.provisional) {
166
+ push({
167
+ section: sectionId,
168
+ reason: 'deferred',
169
+ blocks_stage: findStageThatRequires(`${sectionId}.`, stage),
170
+ first_seen: now,
171
+ last_checked: now,
172
+ owner,
173
+ note: 'Block is provisional — derived from defaults rather than observed data.',
174
+ });
175
+ }
176
+ const overrides = m.field_overrides ?? [];
177
+ const missingOverrides = overrides.filter((o) => o.reason === 'missing' || o.reason === 'illegible');
178
+ if (missingOverrides.length > 0) {
179
+ for (const o of missingOverrides) {
180
+ push({
181
+ section: sectionId,
182
+ field_path: o.path,
183
+ reason: o.reason === 'illegible' ? 'illegible' : 'missing',
184
+ blocks_stage: findStageThatRequires(`${sectionId}.${o.path}`, stage),
185
+ first_seen: now,
186
+ last_checked: now,
187
+ owner,
188
+ note: o.note,
189
+ });
190
+ }
191
+ }
192
+ else if (m.partial) {
193
+ // partial=true but no field_overrides enumeration; record the section.
194
+ push({
195
+ section: sectionId,
196
+ reason: 'missing',
197
+ blocks_stage: findStageThatRequires(`${sectionId}.`, stage),
198
+ first_seen: now,
199
+ last_checked: now,
200
+ owner,
201
+ note: 'Block flagged partial without field-level enumeration.',
202
+ });
203
+ }
204
+ }
205
+ if (!opts.mergeWithExisting)
206
+ return inferred;
207
+ // ── Merge with existing gaps section ───────────────────────────────────────
208
+ const existing = readGapsContent(parsed);
209
+ if (!existing)
210
+ return inferred;
211
+ const out = [];
212
+ const existingByKey = new Map();
213
+ for (const e of existing.items)
214
+ existingByKey.set(keyOf(e.section, e.field_path), e);
215
+ for (const inf of inferred) {
216
+ const k = keyOf(inf.section, inf.field_path);
217
+ const prior = existingByKey.get(k);
218
+ if (prior) {
219
+ out.push({
220
+ ...prior,
221
+ last_checked: now,
222
+ // Preserve prior `reason`, `owner`, `first_seen`, `note`; refresh
223
+ // `blocks_stage` from inference (the stage may have advanced).
224
+ blocks_stage: inf.blocks_stage ?? prior.blocks_stage,
225
+ });
226
+ existingByKey.delete(k);
227
+ }
228
+ else {
229
+ out.push(inf);
230
+ }
231
+ }
232
+ // Carry over prior items the inference run didn't re-discover, untouched.
233
+ for (const remaining of existingByKey.values())
234
+ out.push(remaining);
235
+ return out;
236
+ }
237
+ // ─── Summarization ───────────────────────────────────────────────────────────
238
+ /**
239
+ * Aggregate counts for fast pipeline routing. Mirrors the `summary` object in
240
+ * the gaps section schema (spec/schemas/section-gaps.schema.json).
241
+ */
242
+ export function summarizeGaps(items, currentStage) {
243
+ const next = nextStage(currentStage);
244
+ let blocking_current = 0;
245
+ let blocking_next = 0;
246
+ for (const item of items) {
247
+ if (blocksAtOrBefore(item, currentStage))
248
+ blocking_current++;
249
+ else if (next && blocksAtOrBefore(item, next))
250
+ blocking_next++;
251
+ }
252
+ return {
253
+ total_open: items.length,
254
+ blocking_current_stage: blocking_current,
255
+ blocking_next_stage: blocking_next,
256
+ };
257
+ }
258
+ // ─── Reading the existing gaps section ───────────────────────────────────────
259
+ /**
260
+ * Pull the typed content out of the file's `gaps` section. Returns null when
261
+ * the section is absent or malformed.
262
+ */
263
+ export function readGapsContent(parsed) {
264
+ const block = getSection(parsed, 'gaps');
265
+ if (!block)
266
+ return null;
267
+ const c = block.content;
268
+ if (!c || !Array.isArray(c.items))
269
+ return null;
270
+ return { items: c.items, summary: c.summary };
271
+ }
272
+ //# sourceMappingURL=gaps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gaps.js","sourceRoot":"","sources":["../src/gaps.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,EAAE;AACF,yEAAyE;AACzE,4CAA4C;AAC5C,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,iEAAiE;AAEjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAiClD,gFAAgF;AAEhF,MAAM,WAAW,GAAyB;IACxC,OAAO;IACP,WAAW;IACX,YAAY;IACZ,iBAAiB;IACjB,iBAAiB;IACjB,SAAS;IACT,YAAY;CACb,CAAC;AAEF,SAAS,SAAS,CAAC,KAAgB;IACjC,MAAM,GAAG,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACvC,IAAI,GAAG,KAAK,CAAC,CAAC,IAAI,GAAG,KAAK,WAAW,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IAC9D,OAAO,WAAW,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;AAC9B,CAAC;AAED,SAAS,gBAAgB,CAAC,IAAa,EAAE,KAAgB;IACvD,IAAI,CAAC,IAAI,CAAC,YAAY;QAAE,OAAO,KAAK,CAAC;IACrC,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACvD,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC5C,OAAO,OAAO,KAAK,CAAC,CAAC,IAAI,QAA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B,CAAC,IAAI,EAAE,YAAY,CAAC;YAAE,gBAAgB,EAAE,CAAC;aACxD,IAAI,IAAI,IAAI,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC;YAAE,aAAa,EAAE,CAAC;IACjE,CAAC;IACD,OAAO;QACL,UAAU,EAAE,KAAK,CAAC,MAAM;QACxB,sBAAsB,EAAE,gBAAgB;QACxC,mBAAmB,EAAE,aAAa;KACnC,CAAC;AACJ,CAAC;AAED,gFAAgF;AAEhF;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,MAAoB;IAClD,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,MAAM,CAAC,GAAG,KAAK,CAAC,OAAsC,CAAC;IACvD,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC/C,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,KAAkB,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,75 @@
1
+ export { parseUWFile, getSection, getSectionVariant, deepGet } from './parser.js';
2
+ export { validateUWFile, lookupRemediation } from './validator.js';
3
+ export { compact, diff } from './compactor.js';
4
+ export { render, UnsupportedRenderFormatError } from './renderer.js';
5
+ export type { RenderFormat, RenderTier, RenderOptions, RenderResult } from './renderer.js';
6
+ export { renderReportHtml, REPORT_CSS } from './report.js';
7
+ export type { ReportOptions, ReportResult } from './report.js';
8
+ export { UW_JSON_REPRESENTATION_VERSION, UW_JSON_MEDIA_TYPE, UWJsonError, toUWJson, stringifyUWEnvelope, stringifyUWJson, stringifyUWJsonWithDigest, parseUWJson, parseUWJsonVerified, fromUWJson, UW_JSON_CODEC, } from './uwjson.js';
9
+ export type { ToUWJsonOptions } from './uwjson.js';
10
+ export { UW_XML_REPRESENTATION_VERSION, UW_XML_MEDIA_TYPE, UW_XML_NAMESPACE, UWXmlError, stringifyUWXml, parseUWXml, parseUWXmlVerified, UW_XML_CODEC, } from './uwxml.js';
11
+ export type { UWXmlOptions } from './uwxml.js';
12
+ export { UW_CSV_BUNDLE_VERSION, UW_CSV_BUNDLE_MEDIA_TYPE, UWCSVError, encodeUWCSVBundle, decodeUWCSVBundle, encodeUWCSVZip, decodeUWCSVZip, UW_CSV_BUNDLE_CODEC, } from './uwcsv.js';
13
+ export type { UWCSVBundle, UWCSVDecodeOptions } from './uwcsv.js';
14
+ export { CORE_CODEC_REGISTRY, encodeUWDocument, decodeUWDocument } from './codecs.js';
15
+ export { UWMD_PUBLIC_ORIGIN, UWMD_DEAL_RESOURCE_TEMPLATE, UWBindingError, uwmdDealResourceURI, uwmdETag, createUWHTTPResponse, decodeUWHTTPRequest, assertUWIfMatch, createUWMCPResource, createUWMCPGetDocumentResult, createUWMCPValidationResult, createUWMCPListRepresentationsResult, applyUWMDSourceEdit, createUWMCPApplyEditResult, } from './bindings.js';
16
+ export type { UWHTTPBody, UWHTTPResponse, UWHTTPResponseOptions, UWCSVView, UWMCPResourceContent, UWMCPResourceLink, UWMCPToolResult, UWMCPDocumentOptions, UWSourceEditResult, } from './bindings.js';
17
+ export { UW_ENVELOPE_VERSION, UWEnvelopeError, toUWEnvelope, fromUWEnvelope, envelopeSemanticValue, canonicalizeUWEnvelope, computeEnvelopeDigest, stampEnvelopeDigest, verifyEnvelopeDigest, areEnvelopesEquivalent, assertUWEnvelope, } from './envelope.js';
18
+ export type { UWEnvelopeBlock, UWEnvelopeSectionEntry, UWDocumentEnvelope, ToEnvelopeOptions, EnvelopeDigestVerification, } from './envelope.js';
19
+ export { negotiateRepresentation, resolveInputRepresentation, RepresentationNegotiationError, } from './negotiation.js';
20
+ export type { NegotiationOptions, NegotiatedRepresentation } from './negotiation.js';
21
+ export { CodecRegistry, UWCodecError } from './codec.js';
22
+ export type { UWCodec, RepresentationDescriptor, RepresentationDirection, RepresentationFidelity, } from './codec.js';
23
+ export { writeAgentBlock, writeErrorEntry, buildMeta } from './runner.js';
24
+ export type { AgentOutput, RunOptions, RunResult } from './runner.js';
25
+ export { applyEdit, applyEditAsync, resolvePolicy } from './editor.js';
26
+ export type { EditContext, EditResult, EditOptions } from './editor.js';
27
+ export { evaluateCalc, parseExpression, evaluate, BUILTINS, CalcError, calcError } from './calc/index.js';
28
+ export type { CalcValue, Builtin, CalcErrorCode } from './calc/index.js';
29
+ export { MULTIFAMILY_PACK, OFFICE_PACK, RETAIL_PACK, INDUSTRIAL_PACK, SELF_STORAGE_PACK, getPackForAssetClass, emitFromAst, emitExcelFormula, ExcelEmitError, } from './packs/index.js';
30
+ export type { ExcelEmitOptions } from './packs/index.js';
31
+ export { loadModuleManifest, createModuleRegistry, getModuleCalculationsForAssetClass, ModuleRegistryError, } from './modules.js';
32
+ export type { ModuleRegistry, LoadModuleOptions, CreateModuleRegistryOptions } from './modules.js';
33
+ export { buildAgentContext, buildAgentPrompt, isContextReady, getLayerDependencies, BANCROFT_LAYERS, } from './context.js';
34
+ export type { AgentContext, BancroftPrompt, LayerDefinition } from './context.js';
35
+ export { runBancroftAgent, runBancroftAgentStreaming } from './agents/bancroft.js';
36
+ export type { BancroftRunOptions, BancroftRunResult, ProgressEvent } from './agents/bancroft.js';
37
+ export { WRITE_UW_SECTION_TOOL, WRITE_MULTIPLE_SECTIONS_TOOL, MULTI_SECTION_LAYERS } from './agents/schemas.js';
38
+ export type { ToolOutput } from './agents/schemas.js';
39
+ export { generateBlankUWFile } from './init.js';
40
+ export { deriveRentRoll, rentRollVariant } from './rentroll.js';
41
+ export type { RentRollVariant, RentRollBasis, RentRollDerivation, DerivedField, DerivedKind, } from './rentroll.js';
42
+ export { deriveOperatingStatement } from './opstatement.js';
43
+ export type { OperatingStatementDerivation } from './opstatement.js';
44
+ export { deriveDebt } from './debt.js';
45
+ export type { DebtDerivation } from './debt.js';
46
+ export { deriveSourcesUses } from './sourcesuses.js';
47
+ export type { SourcesUsesDerivation } from './sourcesuses.js';
48
+ export { deriveValuation } from './valuation.js';
49
+ export type { ValuationDerivation } from './valuation.js';
50
+ export { deriveDCF } from './dcf.js';
51
+ export type { DCFDerivation } from './dcf.js';
52
+ export { MULTIFAMILY_DEFAULTS, OFFICE_DEFAULTS, RETAIL_DEFAULTS, INDUSTRIAL_DEFAULTS, SELF_STORAGE_DEFAULTS, getAssetClassDefaults, getDefaultRange, listDefaultedFields, } from './defaults.js';
53
+ export type { DefaultRange, DefaultUnit, AssetClassDefaults } from './defaults.js';
54
+ export { inferGaps, summarizeGaps, readGapsContent } from './gaps.js';
55
+ export type { GapItem, GapReason, GapSummary, GapsContent, InferGapsOptions } from './gaps.js';
56
+ export { sha256Hex, computeBlockHash, verifyChain, verifyProvenance, } from './integrity.js';
57
+ export type { IntegrityCode, IntegrityIssue, IntegrityResult } from './integrity.js';
58
+ export { canonicalize } from './integrity-canonical.js';
59
+ export { resolveValue, readInFile } from './cascade.js';
60
+ export type { CascadeContext, ResolvedValue, MarketDataLookup, InvestorProfile, GlobalDefaults, SystemDefaults, } from './cascade.js';
61
+ export type { UWBlock, UWFenceAnnotation, UWMeta, UWFieldOverride, UWFrontmatter, UWPipelineState, UWQuickMetrics, ParsedUWFile, ParsedSections, ParseOptions, InstitutionConfig, ValidationMessage, ValidationResult, StageReadiness, FinancialThresholds, ConfidenceLevel, PipelineStatus, ValidationSeverity, DealStage, AssetClass, } from './types.js';
62
+ export { DEFAULT_THRESHOLDS } from './types.js';
63
+ export { formatCurrency, formatPercent, formatRatio, formatCount, formatDate, formatNull, formatValue, formatPercentCsv, formatNumberCsv, } from './format.js';
64
+ export type { CurrencyOptions, PercentOptions, RatioOptions, CountOptions, DateOptions, NullOptions, } from './format.js';
65
+ export { PROTOCOL_VERSION, FORMAT_VERSION, DEFAULT_NUMBER_FORMAT, DEFAULT_DATE_FORMAT, BUILTIN_VIEW_MODELS, BUILTIN_EDIT_POLICIES, BUILTIN_REMEDIATIONS, BUILTIN_INCOMPLETE_DATA_POLICIES, CASCADE_ORDER, SOURCE_TAGS, lookupIncompleteDataPolicy, } from './protocol.js';
66
+ export type { ViewerTier, ViewerRole, ViewerCapability, ImplementationManifest, SupportedLocale, NumberFormatRules, DateFormatRules, ConfidenceBadgeStyle, SourceBadge, FlagSeverity, FieldViewHint, SectionViewModel, ViewModelRegistry, EditAuthority, EditPolicy, EditOperation, IssueRemediation, CalcEvaluationContext, CalcResult, AgentHostCapability, ModuleManifest, ModuleSectionDecl, ModuleCalcDecl, ModuleValidationDecl, ModuleAgentLayerDecl, ModuleLoadResult, ProtocolError, ProtocolErrorCategory, CascadeStep, CanonicalSourceTag, GapAction, IncompleteDataPolicy, } from './protocol.js';
67
+ export type { SectionDiff } from './compactor.js';
68
+ export type { InitOptions } from './init.js';
69
+ export { extractDependencyGraph, getExprDependencies } from './calc/dependencies.js';
70
+ export type { DependencyGraph } from './calc/dependencies.js';
71
+ export { rankGaps } from './refinement.js';
72
+ export type { RankGapsOptions, RankGapsResult, RankedGap, OutputSensitivity, NonMonotonicWarning, } from './refinement.js';
73
+ export { buildContext } from './context-profiles.js';
74
+ export type { ContextProfile, BuildContextOptions, ContextResult, } from './context-profiles.js';
75
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AACrE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,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AiB,CAAC;AAEzB,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,aAAa,GACd,MAAM,uBAAuB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,47 @@
1
+ // uwmd — .uw.md file format library
2
+ // Public API surface
3
+ export { parseUWFile, getSection, getSectionVariant, deepGet } from './parser.js';
4
+ export { validateUWFile, lookupRemediation } from './validator.js';
5
+ export { compact, diff } from './compactor.js';
6
+ export { render, UnsupportedRenderFormatError } from './renderer.js';
7
+ export { renderReportHtml, REPORT_CSS } from './report.js';
8
+ export { UW_JSON_REPRESENTATION_VERSION, UW_JSON_MEDIA_TYPE, UWJsonError, toUWJson, stringifyUWEnvelope, stringifyUWJson, stringifyUWJsonWithDigest, parseUWJson, parseUWJsonVerified, fromUWJson, UW_JSON_CODEC, } from './uwjson.js';
9
+ export { UW_XML_REPRESENTATION_VERSION, UW_XML_MEDIA_TYPE, UW_XML_NAMESPACE, UWXmlError, stringifyUWXml, parseUWXml, parseUWXmlVerified, UW_XML_CODEC, } from './uwxml.js';
10
+ export { UW_CSV_BUNDLE_VERSION, UW_CSV_BUNDLE_MEDIA_TYPE, UWCSVError, encodeUWCSVBundle, decodeUWCSVBundle, encodeUWCSVZip, decodeUWCSVZip, UW_CSV_BUNDLE_CODEC, } from './uwcsv.js';
11
+ export { CORE_CODEC_REGISTRY, encodeUWDocument, decodeUWDocument } from './codecs.js';
12
+ export { UWMD_PUBLIC_ORIGIN, UWMD_DEAL_RESOURCE_TEMPLATE, UWBindingError, uwmdDealResourceURI, uwmdETag, createUWHTTPResponse, decodeUWHTTPRequest, assertUWIfMatch, createUWMCPResource, createUWMCPGetDocumentResult, createUWMCPValidationResult, createUWMCPListRepresentationsResult, applyUWMDSourceEdit, createUWMCPApplyEditResult, } from './bindings.js';
13
+ export { UW_ENVELOPE_VERSION, UWEnvelopeError, toUWEnvelope, fromUWEnvelope, envelopeSemanticValue, canonicalizeUWEnvelope, computeEnvelopeDigest, stampEnvelopeDigest, verifyEnvelopeDigest, areEnvelopesEquivalent, assertUWEnvelope, } from './envelope.js';
14
+ export { negotiateRepresentation, resolveInputRepresentation, RepresentationNegotiationError, } from './negotiation.js';
15
+ export { CodecRegistry, UWCodecError } from './codec.js';
16
+ export { writeAgentBlock, writeErrorEntry, buildMeta } from './runner.js';
17
+ export { applyEdit, applyEditAsync, resolvePolicy } from './editor.js';
18
+ export { evaluateCalc, parseExpression, evaluate, BUILTINS, CalcError, calcError } from './calc/index.js';
19
+ export { MULTIFAMILY_PACK, OFFICE_PACK, RETAIL_PACK, INDUSTRIAL_PACK, SELF_STORAGE_PACK, getPackForAssetClass, emitFromAst, emitExcelFormula, ExcelEmitError, } from './packs/index.js';
20
+ export { loadModuleManifest, createModuleRegistry, getModuleCalculationsForAssetClass, ModuleRegistryError, } from './modules.js';
21
+ export { buildAgentContext, buildAgentPrompt, isContextReady, getLayerDependencies, BANCROFT_LAYERS, } from './context.js';
22
+ export { runBancroftAgent, runBancroftAgentStreaming } from './agents/bancroft.js';
23
+ export { WRITE_UW_SECTION_TOOL, WRITE_MULTIPLE_SECTIONS_TOOL, MULTI_SECTION_LAYERS } from './agents/schemas.js';
24
+ export { generateBlankUWFile } from './init.js';
25
+ // ─── Section footing (line items → section totals) ────────────────────────────
26
+ export { deriveRentRoll, rentRollVariant } from './rentroll.js';
27
+ export { deriveOperatingStatement } from './opstatement.js';
28
+ export { deriveDebt } from './debt.js';
29
+ export { deriveSourcesUses } from './sourcesuses.js';
30
+ export { deriveValuation } from './valuation.js';
31
+ export { deriveDCF } from './dcf.js';
32
+ // ─── Asset-class defaults & cascade (Protocol §V.7-§V.8) ──────────────────────
33
+ export { MULTIFAMILY_DEFAULTS, OFFICE_DEFAULTS, RETAIL_DEFAULTS, INDUSTRIAL_DEFAULTS, SELF_STORAGE_DEFAULTS, getAssetClassDefaults, getDefaultRange, listDefaultedFields, } from './defaults.js';
34
+ export { inferGaps, summarizeGaps, readGapsContent } from './gaps.js';
35
+ export { sha256Hex, computeBlockHash, verifyChain, verifyProvenance, } from './integrity.js';
36
+ export { canonicalize } from './integrity-canonical.js';
37
+ export { resolveValue, readInFile } from './cascade.js';
38
+ export { DEFAULT_THRESHOLDS } from './types.js';
39
+ // ─── Display formatting ───────────────────────────────────────────────────────
40
+ export { formatCurrency, formatPercent, formatRatio, formatCount, formatDate, formatNull, formatValue, formatPercentCsv, formatNumberCsv, } from './format.js';
41
+ // ─── Protocol surface ─────────────────────────────────────────────────────────
42
+ export { PROTOCOL_VERSION, FORMAT_VERSION, DEFAULT_NUMBER_FORMAT, DEFAULT_DATE_FORMAT, BUILTIN_VIEW_MODELS, BUILTIN_EDIT_POLICIES, BUILTIN_REMEDIATIONS, BUILTIN_INCOMPLETE_DATA_POLICIES, CASCADE_ORDER, SOURCE_TAGS, lookupIncompleteDataPolicy, } from './protocol.js';
43
+ // ─── Refinement / context profiles (Protocol §IX, §X) ────────────────────────
44
+ export { extractDependencyGraph, getExprDependencies } from './calc/dependencies.js';
45
+ export { rankGaps } from './refinement.js';
46
+ export { buildContext } from './context-profiles.js';
47
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,qBAAqB;AAErB,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG3D,OAAO,EACL,8BAA8B,EAC9B,kBAAkB,EAClB,WAAW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,EACX,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAqCxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,iFAAiF;AACjF,OAAO,EACL,cAAc,EACd,aAAa,EACb,WAAW,EACX,WAAW,EACX,UAAU,EACV,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,eAAe,GAChB,MAAM,aAAa,CAAC;AAUrB,iFAAiF;AACjF,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,gCAAgC,EAChC,aAAa,EACb,WAAW,EACX,0BAA0B,GAC3B,MAAM,eAAe,CAAC;AAwCvB,gFAAgF;AAChF,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAGrF,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAS3C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC"}
package/dist/init.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ import type { AssetClass, DealStage } from './types.js';
2
+ export interface InitOptions {
3
+ dealId?: string;
4
+ dealName?: string;
5
+ address?: string;
6
+ city?: string;
7
+ state?: string;
8
+ zip?: string;
9
+ assetClass?: AssetClass;
10
+ assetSubtype?: string;
11
+ dealStage?: DealStage;
12
+ tier?: 'screener' | 'analyst';
13
+ }
14
+ export declare function generateBlankUWFile(opts?: InitOptions): string;
15
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAExD,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CAC/B;AAYD,wBAAgB,mBAAmB,CAAC,IAAI,GAAE,WAAgB,GAAG,MAAM,CAmKlE"}
package/dist/init.js ADDED
@@ -0,0 +1,169 @@
1
+ // uwmd init — generates a new blank .uw.md file from a template
2
+ // Spec: UW_FORMAT_SPEC_v1.md §6 toolchain interface
3
+ function generateDealId() {
4
+ const year = new Date().getFullYear();
5
+ const hash = Math.random().toString(36).slice(2, 10).toUpperCase();
6
+ return `uw_${year}_${hash}`;
7
+ }
8
+ function isoNow() {
9
+ return new Date().toISOString();
10
+ }
11
+ export function generateBlankUWFile(opts = {}) {
12
+ const dealId = opts.dealId ?? generateDealId();
13
+ const dealName = opts.dealName ?? 'Untitled Deal';
14
+ const now = isoNow();
15
+ const assetClass = opts.assetClass ?? 'multifamily';
16
+ const tier = opts.tier ?? 'screener';
17
+ const dealStage = opts.dealStage ?? 'screening';
18
+ const frontmatter = `---
19
+ uw_version: "1.1"
20
+ deal_id: "${dealId}"
21
+ deal_name: "${dealName}"
22
+ created: "${now}"
23
+ last_modified: "${now}"
24
+
25
+ property_address: "${opts.address ?? ''}"
26
+ city: "${opts.city ?? ''}"
27
+ state: "${opts.state ?? ''}"
28
+ zip: "${opts.zip ?? ''}"
29
+ asset_class: ${assetClass}
30
+ asset_subtype: ${opts.assetSubtype ?? 'null'}
31
+ loan_type: null
32
+ scenario: null
33
+
34
+ pipeline_state:
35
+ L0_ingestion: pending
36
+ L1_screening: pending
37
+ L2_underwriting: pending
38
+ L4_structuring: pending
39
+ L5_compliance: pending
40
+ L6_risk: pending
41
+ L7_assembly: pending
42
+
43
+ status: draft
44
+ deal_stage: ${dealStage}
45
+ recommendation: null
46
+
47
+ quick_metrics:
48
+ purchase_price: null
49
+ loan_amount: null
50
+ noi_underwritten: null
51
+ dscr: null
52
+ ltv: null
53
+ debt_yield: null
54
+ cap_rate: null
55
+ irr_projected: null
56
+ equity_required: null
57
+
58
+ flags: []
59
+ blocking_flags: []
60
+
61
+ tier: ${tier}
62
+ institution_config_id: null
63
+ created_by: wizard
64
+ source_documents: []
65
+ ---`;
66
+ const metaStub = (section) => JSON.stringify({
67
+ _meta: {
68
+ section,
69
+ version: 1,
70
+ superseded: false,
71
+ source: 'wizard',
72
+ agent_id: null,
73
+ agent_version: null,
74
+ actor: 'user',
75
+ timestamp: now,
76
+ confidence: 'low',
77
+ human_review_required: true,
78
+ flags: [],
79
+ input_hash: null,
80
+ notes: null,
81
+ },
82
+ _notes: null,
83
+ }, null, 2);
84
+ const sections = [
85
+ { id: 'deal_context', header: 'Deal Context', label: '§4.0' },
86
+ { id: 'property', header: 'Property', label: '§4.1' },
87
+ { id: 'ownership', header: 'Ownership & Acquisition', label: '§4.2' },
88
+ { id: 'rent_roll', header: 'Rent Roll', label: '§4.3' },
89
+ { id: 'operating_statement', header: 'Operating Statement', label: '§4.4' },
90
+ { id: 'noi_model', header: 'NOI Model', label: '§4.5' },
91
+ { id: 'debt_structure', header: 'Debt Structure', label: '§4.6' },
92
+ { id: 'sources_uses', header: 'Sources & Uses', label: '§4.7' },
93
+ { id: 'valuation', header: 'Valuation', label: '§4.8' },
94
+ { id: 'dcf', header: 'DCF & Hold Period Analysis', label: '§4.9' },
95
+ { id: 'stress_tests', header: 'Stress Tests', label: '§4.10' },
96
+ { id: 'market_analysis', header: 'Market Analysis', label: '§4.11' },
97
+ { id: 'borrower_sponsor', header: 'Borrower / Sponsor', label: '§4.12' },
98
+ { id: 'lease_schedule', header: 'Lease Schedule', label: '§4.13' },
99
+ { id: 'due_diligence', header: 'Due Diligence', label: '§4.14' },
100
+ { id: 'compliance', header: 'Compliance', label: '§4.15' },
101
+ { id: 'assumptions', header: 'Assumptions', label: '§4.16' },
102
+ { id: 'preliminary_sizing', header: 'Preliminary Sizing', label: '§4.17' },
103
+ { id: 'risk_assessment', header: 'Risk Assessment', label: '§4.18' },
104
+ { id: 'validation', header: 'Flags & Validation', label: '§4.19' },
105
+ { id: 'custom_calculations', header: 'Custom Calculations', label: '§4.20' },
106
+ { id: 'custom_scenarios', header: 'Custom Scenarios', label: '§4.21' },
107
+ ];
108
+ const sectionBlocks = sections.map(s => `
109
+ ## ${s.header} {#${s.id}}
110
+
111
+ _${s.label} — Add narrative here._
112
+
113
+ \`\`\`json uw:section=${s.id} source=wizard ts=${now} v=1 confidence=low
114
+ ${metaStub(s.id)}
115
+ \`\`\`
116
+
117
+ ---`).join('\n');
118
+ const pipelineLogEntry = JSON.stringify({
119
+ _meta: {
120
+ section: 'pipeline_log',
121
+ version: 1,
122
+ superseded: false,
123
+ source: 'engine:uwmd',
124
+ agent_id: null,
125
+ agent_version: '1.0.0',
126
+ actor: 'system',
127
+ timestamp: now,
128
+ confidence: 'high',
129
+ human_review_required: false,
130
+ flags: [],
131
+ input_hash: null,
132
+ notes: null,
133
+ },
134
+ entries: [
135
+ {
136
+ entry_id: `log_${Date.now()}`,
137
+ timestamp: now,
138
+ event_type: 'file_created',
139
+ agent_or_actor: 'uwmd:init',
140
+ section_affected: null,
141
+ status: 'success',
142
+ input_sections: [],
143
+ output_sections: [],
144
+ flags_raised: [],
145
+ flags_cleared: [],
146
+ duration_ms: null,
147
+ input_hash: null,
148
+ output_hash: null,
149
+ error_code: null,
150
+ error_message: null,
151
+ notes: `File initialized via uwmd init for deal: ${dealName}`,
152
+ },
153
+ ],
154
+ }, null, 2);
155
+ return `${frontmatter}
156
+
157
+ # ${dealName}
158
+
159
+ > _Deal underwriting file — created ${now.slice(0, 10)}. Fill in sections via the wizard or directly._
160
+ ${sectionBlocks}
161
+
162
+ ## Pipeline Log {#pipeline_log}
163
+
164
+ \`\`\`json uw:section=pipeline_log source=engine:uwmd ts=${now} v=1 confidence=high
165
+ ${pipelineLogEntry}
166
+ \`\`\`
167
+ `;
168
+ }
169
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,oDAAoD;AAiBpD,SAAS,cAAc;IACrB,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACtC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IACnE,OAAO,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;AAC9B,CAAC;AAED,SAAS,MAAM;IACb,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,OAAoB,EAAE;IACxD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,cAAc,EAAE,CAAC;IAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,eAAe,CAAC;IAClD,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IACrB,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,aAAa,CAAC;IACpD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,UAAU,CAAC;IACrC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,WAAW,CAAC;IAEhD,MAAM,WAAW,GAAG;;YAEV,MAAM;cACJ,QAAQ;YACV,GAAG;kBACG,GAAG;;qBAEA,IAAI,CAAC,OAAO,IAAI,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