@thematica/prism-tui 0.0.0-stage → 0.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 (42) hide show
  1. package/README.md +37 -2
  2. package/dist/packages/prism-tui/src/account.d.ts +4 -0
  3. package/dist/packages/prism-tui/src/account.d.ts.map +1 -0
  4. package/dist/packages/prism-tui/src/account.js +25 -0
  5. package/dist/packages/prism-tui/src/account.js.map +1 -0
  6. package/dist/packages/prism-tui/src/cli.d.ts +3 -0
  7. package/dist/packages/prism-tui/src/cli.d.ts.map +1 -0
  8. package/dist/packages/prism-tui/src/cli.js +117 -0
  9. package/dist/packages/prism-tui/src/cli.js.map +1 -0
  10. package/dist/packages/prism-tui/src/credentials.d.ts +11 -0
  11. package/dist/packages/prism-tui/src/credentials.d.ts.map +1 -0
  12. package/dist/packages/prism-tui/src/credentials.js +53 -0
  13. package/dist/packages/prism-tui/src/credentials.js.map +1 -0
  14. package/dist/packages/prism-tui/src/device-login.d.ts +14 -0
  15. package/dist/packages/prism-tui/src/device-login.d.ts.map +1 -0
  16. package/dist/packages/prism-tui/src/device-login.js +78 -0
  17. package/dist/packages/prism-tui/src/device-login.js.map +1 -0
  18. package/dist/src/cli/answer.d.ts +219 -0
  19. package/dist/src/cli/answer.d.ts.map +1 -0
  20. package/dist/src/cli/answer.js +201 -0
  21. package/dist/src/cli/answer.js.map +1 -0
  22. package/dist/src/cli/app/App.d.ts +127 -0
  23. package/dist/src/cli/app/App.d.ts.map +1 -0
  24. package/dist/src/cli/app/App.js +974 -0
  25. package/dist/src/cli/app/App.js.map +1 -0
  26. package/dist/src/cli/app/api.d.ts +130 -0
  27. package/dist/src/cli/app/api.d.ts.map +1 -0
  28. package/dist/src/cli/app/api.js +80 -0
  29. package/dist/src/cli/app/api.js.map +1 -0
  30. package/dist/src/cli/app/run-app.d.ts +9 -0
  31. package/dist/src/cli/app/run-app.d.ts.map +1 -0
  32. package/dist/src/cli/app/run-app.js +11 -0
  33. package/dist/src/cli/app/run-app.js.map +1 -0
  34. package/dist/src/facts/fresh.d.ts +15 -0
  35. package/dist/src/facts/fresh.d.ts.map +1 -0
  36. package/dist/src/facts/fresh.js +22 -0
  37. package/dist/src/facts/fresh.js.map +1 -0
  38. package/dist/src/market/amounts.d.ts +208 -0
  39. package/dist/src/market/amounts.d.ts.map +1 -0
  40. package/dist/src/market/amounts.js +522 -0
  41. package/dist/src/market/amounts.js.map +1 -0
  42. package/package.json +15 -4
@@ -0,0 +1,522 @@
1
+ /**
2
+ * Amounts in other currencies, in US dollars (Ben, 2026-10-22: "Use the Federal Reserve's daily
3
+ * rates, at each report's period end", shown in US dollars with the original in brackets). Pure
4
+ * functions: reading a fact's amount as its sheet writes it ("R$6.5 billion", "CHF 45 million"),
5
+ * with its quote and its report's currency; picking the dated rate for it; converting it. The rates
6
+ * come from assets.exchange_rates (src/market/exchange-rates.ts). A stored fact never changes: the
7
+ * dollar figure is derived, and carries the rate, its day and its source.
8
+ *
9
+ * An amount is converted only when its currency is clear (Prism's rule, 2026-10-23); otherwise it is
10
+ * shown as written. A mark that names one currency ("R$", "RMB", "€", "US$", "CHF") is clear. An
11
+ * ambiguous one ("¥", "Ps.", a bare "$") is settled by the fact's quote, when a clear mark or code
12
+ * stands beside the same number there ("approximately RMB 600 million", "10 million RMB"), else by
13
+ * the report's currency where the rules below allow, else not at all. A clear mark the quote
14
+ * contradicts gives nothing.
15
+ *
16
+ * And how every amount is written for readers (Ben, 2026-10-23: "Use the standard format: US$303.2B
17
+ * in lists, US$303,154 million beside the quote, ISO codes where a currency symbol is shared"): the
18
+ * currency's label (currencyLabel), then the number short in lists and sentences (amountShort,
19
+ * figureDisplay) or as the filing writes it with its scale word beside a quote (amountFull).
20
+ */
21
+ /** Currencies called pesos. */
22
+ const PESOS = new Set(["MXN", "ARS", "CLP", "COP", "PHP", "UYU", "DOP", "CUP"]);
23
+ /** Currencies written with "$", alone or after letters ("HK$", "R$", "Ch$"). */
24
+ const WRITTEN_WITH_DOLLAR = new Set(["CAD", "AUD", "NZD", "HKD", "SGD", "TWD", "BRL", "MXN", "ARS", "CLP", "COP", "UYU", "DOP", "CUP", "BSD", "BBD", "BMD", "BND", "BZD", "FJD", "GYD", "JMD", "KYD", "LRD", "NAD", "SBD", "SRD", "TTD", "XCD"]);
25
+ /** The dollars a bare "$" means in their own reports. */
26
+ const DOLLAR_REPORTS = new Set(["CAD", "AUD", "NZD"]);
27
+ /** Rupees, for "Rs.". */
28
+ const RUPEES = new Set(["INR", "LKR", "PKR", "NPR", "MUR", "SCR"]);
29
+ /** Krone and krona, for "kr". */
30
+ const KRONER = new Set(["SEK", "DKK", "NOK", "ISK"]);
31
+ /**
32
+ * The ambiguous marks and how a report alone settles them (Prism's rule, 2026-10-23):
33
+ * - "¥": yen in a report in yen, yuan in a report in yuan; otherwise unclear.
34
+ * - "Ps.", "P$", "pesos": the report's peso in a report in pesos; otherwise unclear.
35
+ * - a bare "$" and "dollars": US dollars in a report in US dollars, in one with no recorded currency
36
+ * and in one whose currency is not written with "$" (Abivax and AgomAb, reporting in euros, size
37
+ * markets in US dollars as "$9.2 billion"); the Canadian, Australian or New Zealand dollar in a
38
+ * report in it; unclear in a report in any other currency written with "$" (pesos, HKD, SGD, TWD,
39
+ * BRL and the rest: Simec, reporting in pesos, writes a US payment as "$300,000").
40
+ * - "Rs.": the report's rupee in a report in rupees, else the Indian rupee.
41
+ * - "R", "W", "TL", "kr": only in a report in the rand, the won, the lira or a krone.
42
+ */
43
+ const YEN = { family: new Set(["JPY", "CNY"]), byReport: (r) => (r === "JPY" || r === "CNY" ? r : null) };
44
+ const PESO = { family: PESOS, byReport: (r) => (PESOS.has(r) ? r : null) };
45
+ const DOLLAR = { family: new Set(["USD", ...WRITTEN_WITH_DOLLAR]), byReport: (r) => (DOLLAR_REPORTS.has(r) ? r : WRITTEN_WITH_DOLLAR.has(r) ? null : "USD") };
46
+ const RUPEE = { family: RUPEES, byReport: (r) => (RUPEES.has(r) ? r : "INR") };
47
+ const KRONE = { family: KRONER, byReport: (r) => (KRONER.has(r) ? r : null) };
48
+ const onlyIn = (code) => ({ family: new Set([code]), byReport: (r) => (r === code ? code : null) });
49
+ /**
50
+ * ISO 4217 codes an amount may be written with ("CHF 45 million", "500 million USD"). A three-letter
51
+ * word not on this list is not read as a currency, so "TSX 100" or "USDT 5" give nothing.
52
+ */
53
+ const ISO_CODES = new Set(("USD EUR JPY GBP CNY CHF CAD AUD NZD HKD SGD TWD KRW INR IDR MYR THB PHP VND BRL MXN ARS CLP COP PEN UYU PYG BOB " +
54
+ "VES DOP CRC GTQ JMD TTD BSD BBD BMD KYD ZAR NGN KES GHS EGP MAD TND XOF XAF BWP NAD MUR ILS TRY AED SAR QAR KWD BHD " +
55
+ "OMR JOD LBP PKR LKR BDT NPR KZT UZS GEL AMD AZN RUB UAH PLN CZK HUF RON BGN HRK RSD ISK NOK SEK DKK MNT MOP BND FJD").split(" "));
56
+ /**
57
+ * Marks written before the number, tried in order, the most specific first. A mark counts only when
58
+ * the number follows it, so "USDT 5" (a token) is no amount and "RUB 5" is not read as rand.
59
+ */
60
+ const MARK_LIST = [
61
+ { mark: String.raw `ThUS\$`, means: "USD", multiplier: 1e3 },
62
+ { mark: String.raw `US\s?\$|U\.S\.\s?\$|USD\s?\$?`, means: "USD" },
63
+ { mark: String.raw `NT\$|NTD|TWD`, means: "TWD" },
64
+ { mark: String.raw `HK\$|HKD\s?\$?`, means: "HKD" },
65
+ { mark: String.raw `C\$|CA\$|CDN\$|Cdn\$|CAD\s?\$?`, means: "CAD" },
66
+ { mark: String.raw `A\$|AU\$|AUD\s?\$?`, means: "AUD" },
67
+ { mark: String.raw `NZ\$|NZD\s?\$?`, means: "NZD" },
68
+ { mark: String.raw `S\$|SG\$|SGD\s?\$?`, means: "SGD" },
69
+ { mark: String.raw `R\$|BRL`, means: "BRL" },
70
+ { mark: String.raw `ThCh\$`, means: "CLP", multiplier: 1e3 },
71
+ { mark: String.raw `Ch\$|CLP\s?\$?`, means: "CLP" },
72
+ { mark: String.raw `MX\$|Mex\$|MXN\s?\$?`, means: "MXN" },
73
+ { mark: String.raw `COL\$|COP\s?\$?`, means: "COP" },
74
+ { mark: String.raw `AR\$|ARS\s?\$?`, means: "ARS" },
75
+ { mark: String.raw `RMB\s?¥?|CNY|Rmb|CN¥`, means: "CNY" },
76
+ { mark: String.raw `JP¥|JPY`, means: "JPY" },
77
+ { mark: String.raw `[¥¥]`, means: YEN },
78
+ { mark: String.raw `€|EUR|Euro`, means: "EUR" },
79
+ { mark: String.raw `E£|EGP`, means: "EGP" },
80
+ { mark: String.raw `£|GBP`, means: "GBP" },
81
+ { mark: String.raw `CHF|SFr\.?`, means: "CHF" },
82
+ { mark: String.raw `₩|₩|KRW|Won`, means: "KRW" },
83
+ { mark: String.raw `W`, means: onlyIn("KRW") },
84
+ { mark: String.raw `₹|INR`, means: "INR" },
85
+ { mark: String.raw `R[Ss]\.?`, means: RUPEE },
86
+ { mark: String.raw `₪|NIS|ILS`, means: "ILS" },
87
+ { mark: String.raw `Rp\.?|IDR`, means: "IDR" },
88
+ { mark: String.raw `₱|PHP|Php|PhP`, means: "PHP" },
89
+ { mark: String.raw `₺|TRY`, means: "TRY" },
90
+ { mark: String.raw `TL`, means: onlyIn("TRY") },
91
+ { mark: String.raw `₫|VND`, means: "VND" },
92
+ { mark: String.raw `RM|MYR`, means: "MYR" },
93
+ { mark: String.raw `ZAR`, means: "ZAR" },
94
+ { mark: String.raw `R`, means: onlyIn("ZAR") },
95
+ { mark: String.raw `S\/\.?|PEN`, means: "PEN" },
96
+ { mark: String.raw `₸|KZT`, means: "KZT" },
97
+ { mark: String.raw `AED|Dhs\.?`, means: "AED" },
98
+ { mark: String.raw `SEK|SKr`, means: "SEK" },
99
+ { mark: String.raw `DKK|DKr`, means: "DKK" },
100
+ { mark: String.raw `NOK|NKr`, means: "NOK" },
101
+ { mark: String.raw `kr\.?`, means: KRONE },
102
+ { mark: String.raw `THB|฿`, means: "THB" },
103
+ { mark: String.raw `Ps\.?\s?\$?`, means: PESO },
104
+ { mark: String.raw `P\$`, means: PESO },
105
+ { mark: String.raw `\$`, means: DOLLAR },
106
+ ];
107
+ /** Where the number starts: a sign or a bracket, a space, then a digit. */
108
+ const NUMBER_FOLLOWS = String.raw `(?=[(\-−–]?\s?\d)`;
109
+ /** Each mark at the start of an amount, followed by its number. */
110
+ const AMOUNT_MARKS = MARK_LIST.map((m) => ({ ...m, re: new RegExp(`^(?:${m.mark})\\s?${NUMBER_FOLLOWS}`) }));
111
+ /** Each clear mark at the end of the words before a number in a quote, after a space or a sign. */
112
+ const QUOTE_MARKS = MARK_LIST.flatMap((m) => (typeof m.means === "string" ? [{ currency: m.means, re: new RegExp(`(?:^|[^A-Za-z])(?:${m.mark})\\s?\\(?$`) }] : []));
113
+ /** Words after a number that name one currency, in an amount or in a quote. "pounds" alone is left out: filings weigh uranium in them. */
114
+ const CLEAR_WORDS_AFTER = [
115
+ [/^(?:U\.S\.|US|United States) dollars?\b/i, "USD"],
116
+ [/^Canadian dollars?\b/i, "CAD"],
117
+ [/^Australian dollars?\b/i, "AUD"],
118
+ [/^New Zealand dollars?\b/i, "NZD"],
119
+ [/^Hong Kong dollars?\b/i, "HKD"],
120
+ [/^Singapore dollars?\b/i, "SGD"],
121
+ [/^(?:New )?Taiwan(?:ese)? dollars?\b/i, "TWD"],
122
+ [/^Mexican pesos?\b/i, "MXN"],
123
+ [/^Argentine pesos?\b/i, "ARS"],
124
+ [/^Chilean pesos?\b/i, "CLP"],
125
+ [/^Colombian pesos?\b/i, "COP"],
126
+ [/^Philippine pesos?\b/i, "PHP"],
127
+ [/^(?:yuan|renminbi|RMB)\b/i, "CNY"],
128
+ [/^(?:Japanese )?yen\b/i, "JPY"],
129
+ [/^euros?\b/i, "EUR"],
130
+ [/^(?:Brazilian )?reais\b/i, "BRL"],
131
+ [/^Swiss francs?\b/i, "CHF"],
132
+ [/^(?:South )?Korean won\b/i, "KRW"],
133
+ [/^Indian rupees?\b/i, "INR"],
134
+ [/^pounds? sterling\b/i, "GBP"],
135
+ [/^South African rand\b/i, "ZAR"],
136
+ ];
137
+ /** Words after the number in an amount that are ambiguous, as the marks are; "won" after a number is the won. */
138
+ const AMBIGUOUS_WORDS_AFTER = [
139
+ [/^dollars?\b/i, DOLLAR],
140
+ [/^pesos?\b/i, PESO],
141
+ [/^rupees?\b/i, RUPEE],
142
+ [/^won\b/i, "KRW"],
143
+ ];
144
+ const QUALIFIER = /^(approximately|approx\.|about|around|roughly|nearly|almost|over|more than|less than|under|up to|at least|at most|~|≈|>|<)(?![A-Za-z])\s*/i;
145
+ const NUMBER = /^([(\-−–]?)\s?(\d{1,3}(?:,\d{3})+|\d{1,3}(?: \d{3})+(?!\d)|\d+)(?:(\.\d+)|,(\d{1,2})(?!\d))?(\)?)/;
146
+ /** The scales Prism reads (since 2026-10-23 also bln, mln, Mio., Mrd. and lakh crore). */
147
+ const SCALE = /^\s?(lakhs?\s+crores?|thousands?|millions?|billions?|trillions?|bn|mn|tn|mm|bln|mln|mio\.?|mrd\.?|crores?|lakhs?|k|m|b|t)(?![A-Za-z])/i;
148
+ const SCALES = { thousand: 1e3, million: 1e6, billion: 1e9, trillion: 1e12, bn: 1e9, mn: 1e6, tn: 1e12, mm: 1e6, bln: 1e9, mln: 1e6, mio: 1e6, mrd: 1e9, crore: 1e7, lakh: 1e5, k: 1e3, m: 1e6, b: 1e9, t: 1e12 };
149
+ /** Words after a number that look like a scale Prism does not read ("R$5 mil", "₹5 Cr", "€2 Md"): the amount is unclear. */
150
+ const UNKNOWN_SCALE = /^\s?(?:mil|mill|mils|millones|mill[oó]n|milh[õo]es|milh[ãa]o|bilh[õo]es|bilh[ãa]o|billones|bi|bil|bill|tri|tril|trn|md|mds|mld|mlrd|milliards?|miljard(?:er)?|miljoner|lacs?|cr|crs|cror(?:es)?|thou|thous|ths|tsd)\.?(?![A-Za-z])/i;
151
+ /** Another amount after the first: a currency sign or code right before a digit, as in "MYR 1,234 million ($300 million)". */
152
+ const ANOTHER_AMOUNT = /(?:[$€£¥¥₩₩₹₪₱₺₫₸฿]|\b(?:RMB|Rs\.?|Rp|RM)|\b[A-Z]{3})\s?\(?\d/;
153
+ /** A range or a second figure joined to the first: "€0.8 BN to €1.0 BN a year", "Php5 to Php10". */
154
+ const RANGE = /^(?:to|and|or|through|-|–|—|\/)\s*\S*\d/i;
155
+ const escapeRegExp = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
156
+ /** What a scale word counts: 1e6 for "million", "mln" or "Mio.", 1e12 for "lakh crore"; null for none. */
157
+ function scaleOf(word) {
158
+ const w = word.toLowerCase().replace(/\.$/, "").replace(/\s+/g, " ");
159
+ if (/^lakhs? crores?$/.test(w))
160
+ return 1e12;
161
+ return SCALES[w] ?? SCALES[w.replace(/s$/, "")] ?? null;
162
+ }
163
+ /** Each scale word Prism reads, as Prism writes it beside a quote. */
164
+ const SCALE_WORDS = { thousand: "thousand", million: "million", billion: "billion", trillion: "trillion", bn: "billion", mn: "million", tn: "trillion", mm: "million", bln: "billion", mln: "million", mio: "million", mrd: "billion", crore: "crore", lakh: "lakh", k: "thousand", m: "million", b: "billion", t: "trillion" };
165
+ /** A scale word as Prism writes it: "billion" for "bn" or "Mrd.", "lakh crore" for "lakh crores". */
166
+ function scaleWord(word) {
167
+ const w = word.toLowerCase().replace(/\.$/, "").replace(/\s+/g, " ");
168
+ if (/^lakhs? crores?$/.test(w))
169
+ return "lakh crore";
170
+ return SCALE_WORDS[w] ?? SCALE_WORDS[w.replace(/s$/, "")] ?? "";
171
+ }
172
+ /** The one currency words right after a number name in a quote ("10 million RMB", "5 billion U.S. dollars"), or null. */
173
+ function clearAfter(after) {
174
+ const a = after.replace(/^\)/, "");
175
+ const s = SCALE.exec(a);
176
+ const rest = (s === null ? a : a.slice(s[0].length)).trimStart();
177
+ const code = /^([A-Z]{3})(?![A-Za-z])/.exec(rest)?.[1];
178
+ if (code !== undefined && ISO_CODES.has(code))
179
+ return code;
180
+ return CLEAR_WORDS_AFTER.find(([re]) => re.test(rest))?.[1] ?? null;
181
+ }
182
+ /** The one currency a clear mark or code right before a number names in a quote ("approximately RMB 600"), or null. */
183
+ function clearBefore(before) {
184
+ const mark = QUOTE_MARKS.find((m) => m.re.test(before));
185
+ if (mark !== undefined)
186
+ return mark.currency;
187
+ const code = /(?:^|[^A-Za-z])([A-Z]{3})\s?\(?$/.exec(before)?.[1];
188
+ return code !== undefined && ISO_CODES.has(code) ? code : null;
189
+ }
190
+ /**
191
+ * The currencies a fact's quote names beside a number, as a clear mark or code before it or words
192
+ * after it. Ambiguous marks ("$", "¥", "Ps.") name none. Empty when the quote does not hold the
193
+ * number, or holds it with no clear currency.
194
+ */
195
+ export function quoteCurrencies(quote, numberText) {
196
+ const out = new Set();
197
+ if (quote === null || quote === undefined || numberText === "")
198
+ return out;
199
+ const q = quote.replace(/\s+/g, " ");
200
+ const re = new RegExp(`(?<![\\d.,])${escapeRegExp(numberText)}(?!\\d|[.,]\\d)`, "g");
201
+ for (const m of q.matchAll(re)) {
202
+ const at = m.index ?? 0;
203
+ for (const c of [clearBefore(q.slice(Math.max(0, at - 24), at)), clearAfter(q.slice(at + m[0].length, at + m[0].length + 48))])
204
+ if (c !== null)
205
+ out.add(c);
206
+ }
207
+ return out;
208
+ }
209
+ /** An amount's mark before the number and its word after it, read together: a clear one wins over an ambiguous one it fits, and two clear ones must agree. */
210
+ function together(a, b) {
211
+ if (a === null)
212
+ return b;
213
+ if (b === null)
214
+ return a;
215
+ if (typeof a === "string" && typeof b === "string")
216
+ return a === b ? a : "conflict";
217
+ if (typeof a === "string")
218
+ return b.family.has(a) ? a : "conflict";
219
+ if (typeof b === "string")
220
+ return a.family.has(b) ? b : "conflict";
221
+ return a;
222
+ }
223
+ /**
224
+ * A fact's amount as its sheet writes it, read as currency, number and multiplier; null when it is
225
+ * not an amount of money with a clear currency: a count ("50 years", "158,000 sites"), a share, a
226
+ * range, two amounts, an unknown mark, a number with no currency at all, a number written unclearly
227
+ * ("US$1,271,1 million", "R$534.669 thousand", "R$5 mil"), or an ambiguous mark that neither the
228
+ * quote nor the report settles. `reportCurrency` is the currency of the report the sheet was written
229
+ * from (asset_data.filings.currency); null reads as a report in US dollars. `quote` is the fact's own
230
+ * quote: a clear currency beside the same number there settles an ambiguous mark, and one that
231
+ * differs from a clear mark makes the amount unclear. The amount must start the text, after a word
232
+ * such as "approximately"; words after it, such as "a year" or "per share", are allowed.
233
+ */
234
+ export function readAmount(text, reportCurrency, quote) {
235
+ const p = readAmountParts(text, reportCurrency, quote);
236
+ if (p === null || p.currency === null)
237
+ return null;
238
+ return { currency: p.currency, number: p.number, multiplier: p.multiplier, ...(p.qualifier !== undefined ? { qualifier: p.qualifier } : {}) };
239
+ }
240
+ /**
241
+ * An amount read as readAmount reads it, with what showing it needs: the number as written, its
242
+ * scale word and the words after it. Where readAmount gives nothing only because the currency is not
243
+ * clear, this gives the amount with `currency` null: a number with no mark at all and nothing after
244
+ * it ("2,995,255 thousand"; a count names its unit, "50 years", and stays no amount), an ambiguous
245
+ * mark neither the quote nor the report settles ("¥700 million" in a report in reais), or a mark the
246
+ * quote contradicts. Whether the text is an amount at all does not depend on the report or the quote.
247
+ */
248
+ export function readAmountParts(text, reportCurrency, quote) {
249
+ if (text === null || text === undefined)
250
+ return null;
251
+ const report = reportCurrency ?? "USD";
252
+ // \s also matches no-break and thin spaces, so "€3 085 million" reads like "€3 085 million".
253
+ let t = text.replace(/\s+/g, " ").trim();
254
+ const q = QUALIFIER.exec(t);
255
+ const qualifier = q?.[1];
256
+ if (q !== null)
257
+ t = t.slice(q[0].length);
258
+ let before = null;
259
+ let multiplier = 1;
260
+ let scale = "";
261
+ const mark = AMOUNT_MARKS.find((m) => m.re.test(t));
262
+ if (mark !== undefined) {
263
+ before = mark.means;
264
+ multiplier = mark.multiplier ?? 1;
265
+ if (multiplier === 1e3)
266
+ scale = "thousand";
267
+ t = t.slice(mark.re.exec(t)[0].length);
268
+ }
269
+ else {
270
+ // A plain ISO code before the number: "PLN 120 million".
271
+ const code = /^([A-Z]{3})\s?(?=[(\-−–]?\d)/.exec(t);
272
+ if (code !== null && ISO_CODES.has(code[1])) {
273
+ before = code[1];
274
+ t = t.slice(code[0].length);
275
+ }
276
+ }
277
+ const n = NUMBER.exec(t);
278
+ if (n === null)
279
+ return null;
280
+ const [all, sign = "", whole = "", decimals, decimalComma, close = ""] = n;
281
+ if ((sign === "(") !== (close === ")"))
282
+ return null;
283
+ // Thousands with commas and then a decimal comma ("US$1,271,1 million", "US$4,123,549,73") are unclear.
284
+ if (decimalComma !== undefined && whole.includes(","))
285
+ return null;
286
+ t = t.slice(all.length);
287
+ // A dot or a comma right after the number leaves it unclear ("1.234.567", "1,2,3"); a percent sign makes it a share.
288
+ if (/^[.,]\d|^%/.test(t))
289
+ return null;
290
+ const numberText = `${whole}${decimals ?? (decimalComma !== undefined ? `,${decimalComma}` : "")}`;
291
+ let number = Number(`${whole.replace(/[, ]/g, "")}${decimals ?? (decimalComma !== undefined ? `.${decimalComma}` : "")}`);
292
+ if (!Number.isFinite(number) || number === 0)
293
+ return null;
294
+ if (sign !== "")
295
+ number = -number;
296
+ const s = SCALE.exec(t);
297
+ if (s !== null) {
298
+ if (multiplier !== 1)
299
+ return null;
300
+ multiplier = scaleOf(s[1]) ?? 0;
301
+ if (multiplier === 0)
302
+ return null;
303
+ // Three decimals before "thousand" ("R$534.669 thousand") may be a thousands dot: unclear. Before a
304
+ // larger scale they are ordinary precision ("US$9.467 billion": 124 such facts on 2026-10-23).
305
+ if (multiplier === 1e3 && decimals !== undefined && decimals.length === 4)
306
+ return null;
307
+ scale = scaleWord(s[1]);
308
+ t = t.slice(s[0].length);
309
+ }
310
+ else if (UNKNOWN_SCALE.test(t))
311
+ return null;
312
+ else if (/^[A-Za-z]/.test(t) && !ISO_CODES.has(/^[A-Z]{3}(?![A-Za-z])/.exec(t)?.[0] ?? "") && !/^RMB(?![A-Za-z])/.test(t))
313
+ return null;
314
+ // A currency named after the number: "500 million USD", "$1,234 CAD", "10 million RMB", "193,737 million dollars".
315
+ const rest = t.trimStart();
316
+ const code = /^([A-Z]{3})(?![A-Za-z])/.exec(rest)?.[1];
317
+ const word = CLEAR_WORDS_AFTER.find(([re]) => re.test(rest)) ?? AMBIGUOUS_WORDS_AFTER.find(([re]) => re.test(rest));
318
+ const after = code !== undefined && ISO_CODES.has(code) ? code : code === "RMB" ? "CNY" : (word?.[1] ?? null);
319
+ if (RANGE.test(rest) || ANOTHER_AMOUNT.test(rest.replace(/^[A-Z]{3}(?![A-Za-z])/, "")))
320
+ return null;
321
+ // The words after the amount, less the currency they name, and less a full stop or comma that ends them.
322
+ const named = after === null ? 0 : code !== undefined && (ISO_CODES.has(code) || code === "RMB") ? code.length : (word?.[0].exec(rest)?.[0].length ?? 0);
323
+ const tail = rest.slice(named).trim().replace(/[.,;:]+$/, "").trim();
324
+ const parts = { number, multiplier, written: `${sign}${numberText}${close}`, scale, tail, ...(qualifier !== undefined ? { qualifier } : {}) };
325
+ const own = together(before, after);
326
+ // No mark at all: a bare number is an amount whose currency is not stated; one with words after it is a count ("50 years").
327
+ if (own === null)
328
+ return tail === "" ? { currency: null, ...parts } : null;
329
+ if (own === "conflict")
330
+ return { currency: null, ...parts };
331
+ // The quote beside the same number settles an ambiguous mark, and must not contradict a clear one.
332
+ const inQuote = quoteCurrencies(quote, numberText);
333
+ let currency;
334
+ if (typeof own === "string")
335
+ currency = inQuote.size > 0 && !inQuote.has(own) ? null : own;
336
+ else if (inQuote.size > 1)
337
+ currency = null;
338
+ else if (inQuote.size === 1) {
339
+ const only = [...inQuote][0];
340
+ currency = own.family.has(only) ? only : null;
341
+ }
342
+ else
343
+ currency = own.byReport(report);
344
+ return { currency, ...parts };
345
+ }
346
+ /** A word before an amount that says it is not exact ("over €1 billion" gives "over"), or "". */
347
+ export function leadingQualifier(text) {
348
+ return QUALIFIER.exec((text ?? "").trim())?.[1] ?? "";
349
+ }
350
+ /** A table of rates. `lastDay` is each currency's latest stored day; left out, it is the latest of `rates`. */
351
+ export function rateTable(rates, lastDay) {
352
+ const by = new Map();
353
+ for (const r of rates) {
354
+ const list = by.get(r.currency) ?? [];
355
+ list.push(r);
356
+ by.set(r.currency, list);
357
+ }
358
+ for (const list of by.values())
359
+ list.sort((a, b) => b.date.localeCompare(a.date));
360
+ return { byCurrency: by, lastDay: lastDay ?? new Map([...by].map(([c, list]) => [c, list[0].date])) };
361
+ }
362
+ /** No rates at all: every amount in another currency is shown as written. */
363
+ export const NO_RATES = rateTable([]);
364
+ /** How far back from a report's period end a rate may be: weekends and holidays have none (Prism's rule, 2026-10-23). */
365
+ export const RATE_WINDOW_DAYS = 10;
366
+ /** The day `days` before a YYYY-MM-DD day. */
367
+ export function daysBefore(day, days) {
368
+ return new Date(Date.parse(`${day}T00:00:00Z`) - days * 86_400_000).toISOString().slice(0, 10);
369
+ }
370
+ /**
371
+ * The rate on `day`, or the latest one before it within RATE_WINDOW_DAYS; null when there is none,
372
+ * and when `day` is after the currency's latest stored day: until a load reaches that day, the last
373
+ * rate before it may not be the one for it.
374
+ */
375
+ export function pickRate(table, currency, day) {
376
+ const last = table.lastDay.get(currency);
377
+ if (last === undefined || day > last)
378
+ return null;
379
+ const earliest = daysBefore(day, RATE_WINDOW_DAYS);
380
+ return (table.byCurrency.get(currency) ?? []).find((r) => r.date <= day && r.date >= earliest) ?? null;
381
+ }
382
+ /**
383
+ * An amount in US dollars: as written when it is in dollars (fx null), or at the rate on its report's
384
+ * period end (fx says which). Null when the text is not an amount with a clear currency (readAmount,
385
+ * with the fact's quote), or no rate is near enough; such an amount is shown only as written.
386
+ */
387
+ export function inUsd(text, report, rates, quote) {
388
+ const a = readAmount(text, report.currency, quote);
389
+ if (a === null)
390
+ return null;
391
+ const value = a.number * a.multiplier;
392
+ if (a.currency === "USD")
393
+ return { usd: cents(value), fx: null };
394
+ if (report.periodEnd === null)
395
+ return null;
396
+ const rate = pickRate(rates, a.currency, report.periodEnd);
397
+ if (rate === null)
398
+ return null;
399
+ return { usd: cents(value * rate.usdPerUnit), fx: { currency: a.currency, rate: rate.usdPerUnit, date: rate.date, source: rate.source } };
400
+ }
401
+ const cents = (usd) => Math.round(usd * 100) / 100;
402
+ /**
403
+ * Several amounts given as one figure (the most-money line joins a company's figures with " + "),
404
+ * each with its fact's quote: their sum in US dollars, with the one rate used. Null when any of them
405
+ * has no dollars, or when they are in two currencies other than the dollar, so the line shows its
406
+ * originals only.
407
+ */
408
+ export function sumInUsd(parts, report, rates) {
409
+ if (parts.length === 0)
410
+ return null;
411
+ const each = parts.map((p) => inUsd(p.text, report, rates, p.quote));
412
+ if (each.some((e) => e === null))
413
+ return null;
414
+ const fxs = each.map((e) => e?.fx).filter((f) => f !== null && f !== undefined);
415
+ if (new Set(fxs.map((f) => `${f.currency} ${f.date}`)).size > 1)
416
+ return null;
417
+ return { usd: cents(each.reduce((a, e) => a + (e?.usd ?? 0), 0)), fx: fxs[0] ?? null };
418
+ }
419
+ // ---------------------------------------------------------------------------------------------
420
+ // How amounts are written for readers (Ben, 2026-10-23)
421
+ /**
422
+ * Currencies with a label of their own: US dollars as "US$", other dollars with their country's
423
+ * letters, and the euro, the pound, the rupee, the won and the real with their own symbols.
424
+ */
425
+ const LABELS = { USD: "US$", CAD: "C$", AUD: "A$", NZD: "NZ$", HKD: "HK$", SGD: "S$", TWD: "NT$", EUR: "€", GBP: "£", INR: "₹", KRW: "₩", BRL: "R$" };
426
+ /**
427
+ * The label an amount's number follows: "US$", "C$", "€" or "R$"; for every other currency, and any
428
+ * whose symbol other currencies share (¥ for yen and yuan, kr, Ps., S/, R, Fr), its ISO code and a
429
+ * space: "JPY ", "CNY ", "PEN ".
430
+ */
431
+ export const currencyLabel = (code) => LABELS[code] ?? `${code} `;
432
+ /**
433
+ * A million or more written short, with one decimal in billions and trillions (Ben, 2026-10-23:
434
+ * "US$303.2B"): "1.2T", "303.2B", "19.2B", "962M", and under ten million one decimal, "2.5M".
435
+ */
436
+ export function shortNumber(v) {
437
+ if (v >= 999.95e9)
438
+ return `${(v / 1e12).toFixed(1)}T`;
439
+ if (v >= 999.5e6)
440
+ return `${(v / 1e9).toFixed(1)}B`;
441
+ if (v >= 9.95e6)
442
+ return `${Math.round(v / 1e6)}M`;
443
+ return `${(v / 1e6).toFixed(1)}M`;
444
+ }
445
+ /** US dollars written short, as an amount Prism converted reads: "US$1.2B", "US$962M", "US$2.5M", "US$37,313", "US$1.33". */
446
+ export function usdShort(usd) {
447
+ const v = Math.abs(usd);
448
+ const body = v >= 1e6 ? shortNumber(v) : v >= 1000 ? Math.round(v).toLocaleString("en-US") : v.toFixed(2);
449
+ return `${usd < 0 ? "-" : ""}US$${body}`;
450
+ }
451
+ /** The rate amounts were converted at, in words said once after them: "at the Federal Reserve's rate of 2025-12-31"; empty when none was converted. */
452
+ export function rateNote(fxs) {
453
+ const used = fxs.filter((f) => f !== null && f !== undefined);
454
+ if (used.length === 0)
455
+ return "";
456
+ const days = [...new Set(used.map((f) => f.date))].sort();
457
+ return `at the Federal Reserve's rate${new Set(used.map((f) => f.currency)).size > 1 ? "s" : ""} of ${days.join(" and ")}`;
458
+ }
459
+ const CURRENCY_NOT_STATED = "currency not stated";
460
+ const SCALE_NOT_CONFIRMED = "scale not confirmed";
461
+ /** A number written with a decimal comma ("1,5"): never shortened, so it is never read as another number. */
462
+ const DECIMAL_COMMA = /^[(\-−–]?\d+,\d{1,2}\)?$/;
463
+ /**
464
+ * An amount in its own currency, and the notes on what is not clear about it, apart, so a caller can
465
+ * put them in brackets after it or after a comma inside brackets. Short: the label and the number
466
+ * written short ("R$14.2B"); below a million, or with a decimal comma, the full number. Full: the
467
+ * label, the number as the filing writes it and its scale word ("R$14,153.8 million"). Not an amount:
468
+ * as written. An amount whose currency is not clear: as written, noted.
469
+ */
470
+ export function amountAndNotes(a, form) {
471
+ const notes = a.scaleConfirmed === false ? [SCALE_NOT_CONFIRMED] : [];
472
+ const asWritten = a.text.replace(/\s+/g, " ").trim();
473
+ const p = a.parts;
474
+ if (p === null)
475
+ return { text: asWritten, notes };
476
+ if (p.currency === null)
477
+ return { text: asWritten, notes: [CURRENCY_NOT_STATED, ...notes] };
478
+ const q = p.qualifier === undefined ? "" : `${p.qualifier} `;
479
+ const tail = p.tail === "" ? "" : ` ${p.tail}`;
480
+ const label = currencyLabel(p.currency);
481
+ const value = p.number * p.multiplier;
482
+ if (form === "short" && Math.abs(value) >= 1e6 && !DECIMAL_COMMA.test(p.written))
483
+ return { text: `${q}${value < 0 ? "-" : ""}${label}${shortNumber(Math.abs(value))}${tail}`, notes };
484
+ return { text: `${q}${label}${p.written}${p.scale === "" ? "" : ` ${p.scale}`}${tail}`, notes };
485
+ }
486
+ const withNotes = (o) => [o.text, ...o.notes.map((n) => `(${n})`)].join(" ");
487
+ /** An amount in lists and sentences: "US$303.2B", "PEN 10.9B", "¥700 million (currency not stated)", "US$303,154 (scale not confirmed)". */
488
+ export const amountShort = (a) => withNotes(amountAndNotes(a, "short"));
489
+ /** An amount beside its quote: "US$303,154 million", "R$14,153.8 million", "PEN 10,876,215,000". */
490
+ export const amountFull = (a) => withNotes(amountAndNotes(a, "full"));
491
+ /** What a converted amount is in US dollars, said beside the full form: "(about US$2.6B at the Federal Reserve's rate of 2025-12-31)"; empty when it was not converted. */
492
+ export function aboutUsd(usd, fx) {
493
+ if (fx === null || fx === undefined || typeof usd !== "number" || !Number.isFinite(usd))
494
+ return "";
495
+ return `(about ${usdShort(usd)} ${rateNote([fx])})`;
496
+ }
497
+ /**
498
+ * A figure of one or more amounts (the most-money line joins them with " + ") as lists and sentences
499
+ * show it: each amount short; when Prism converted it into US dollars, the dollars first and the
500
+ * originals in brackets, "US$2.6B (R$14.2B)", a word such as "over" kept with both, and any note
501
+ * after the whole. The rate is said by whoever shows the figure, after its period.
502
+ */
503
+ export function figureDisplay(amounts, converted) {
504
+ const each = amounts.map((a) => amountAndNotes(a, "short"));
505
+ if (converted === null || converted === undefined || converted.fx === null || !Number.isFinite(converted.usd))
506
+ return each.map(withNotes).join(" + ");
507
+ const q = amounts[0]?.parts?.qualifier;
508
+ return withNotes({ text: `${q === undefined ? "" : `${q} `}${usdShort(converted.usd)} (${each.map((o) => o.text).join(" + ")})`, notes: [...new Set(each.flatMap((o) => o.notes))] });
509
+ }
510
+ /**
511
+ * What the API gives with a figure so callers can show it (since 2026-10-23): its currency, null
512
+ * when it is not clear or not money, or when the figure's amounts are in different currencies; its
513
+ * multiplier as read (1, 1,000, 1,000,000, 1,000,000,000), null when its amounts differ; and
514
+ * `display`, the figure exactly as Prism's lists and sentences show it (figureDisplay).
515
+ */
516
+ export function amountFields(amounts, converted) {
517
+ const read = amounts.map((a) => a.parts);
518
+ const same = (xs) => (xs.length > 0 && xs.every((x) => x === xs[0]) ? xs[0] : null);
519
+ const all = read.length > 0 && read.every((p) => p !== null);
520
+ return { currency: all ? same(read.map((p) => p?.currency ?? null)) : null, multiplier: all ? same(read.map((p) => p?.multiplier ?? null)) : null, display: figureDisplay(amounts, converted) };
521
+ }
522
+ //# sourceMappingURL=amounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"amounts.js","sourceRoot":"","sources":["../../../../../src/market/amounts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAgCH,+BAA+B;AAC/B,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AAChF,gFAAgF;AAChF,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK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{
2
2
  "name": "@thematica/prism-tui",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "description": "Prism terminal app for theme research",
7
+ "engines": { "node": ">=22" },
8
+ "bin": { "prism": "dist/packages/prism-tui/src/cli.js" },
9
+ "files": ["dist", "README.md"],
10
+ "scripts": { "build": "pnpm --dir ../.. exec tsc -p packages/prism-tui/tsconfig.json", "prepack": "pnpm build" },
11
+ "dependencies": {
12
+ "ink": "7.1.1",
13
+ "ink-text-input": "6.0.0",
14
+ "react": "19.2.8"
15
+ },
16
+ "license": "UNLICENSED"
17
+ }