opencandle 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +106 -14
  3. package/dist/cli.js +2 -1
  4. package/dist/cli.js.map +1 -1
  5. package/dist/config.d.ts +19 -3
  6. package/dist/config.js +61 -2
  7. package/dist/config.js.map +1 -1
  8. package/dist/infra/browser.d.ts +1 -3
  9. package/dist/infra/browser.js +1 -1
  10. package/dist/infra/browser.js.map +1 -1
  11. package/dist/infra/rate-limiter.d.ts +4 -0
  12. package/dist/infra/rate-limiter.js +5 -1
  13. package/dist/infra/rate-limiter.js.map +1 -1
  14. package/dist/memory/manager.d.ts +9 -0
  15. package/dist/memory/manager.js +28 -11
  16. package/dist/memory/manager.js.map +1 -1
  17. package/dist/memory/storage.d.ts +3 -2
  18. package/dist/memory/storage.js.map +1 -1
  19. package/dist/memory/types.js +4 -0
  20. package/dist/memory/types.js.map +1 -1
  21. package/dist/pi/opencandle-extension.js +230 -36
  22. package/dist/pi/opencandle-extension.js.map +1 -1
  23. package/dist/pi/setup.js +10 -0
  24. package/dist/pi/setup.js.map +1 -1
  25. package/dist/prompts/context-builder.d.ts +18 -3
  26. package/dist/prompts/context-builder.js +102 -16
  27. package/dist/prompts/context-builder.js.map +1 -1
  28. package/dist/prompts/disclaimer.js +1 -1
  29. package/dist/prompts/disclaimer.js.map +1 -1
  30. package/dist/prompts/policy-cards.d.ts +13 -0
  31. package/dist/prompts/policy-cards.js +197 -0
  32. package/dist/prompts/policy-cards.js.map +1 -0
  33. package/dist/prompts/sections.js +3 -3
  34. package/dist/prompts/sections.js.map +1 -1
  35. package/dist/prompts/workflow-prompts.js +170 -18
  36. package/dist/prompts/workflow-prompts.js.map +1 -1
  37. package/dist/providers/alpha-vantage.js +23 -1
  38. package/dist/providers/alpha-vantage.js.map +1 -1
  39. package/dist/providers/sec-edgar.d.ts +8 -1
  40. package/dist/providers/sec-edgar.js +172 -5
  41. package/dist/providers/sec-edgar.js.map +1 -1
  42. package/dist/providers/yahoo-finance.d.ts +2 -0
  43. package/dist/providers/yahoo-finance.js +134 -3
  44. package/dist/providers/yahoo-finance.js.map +1 -1
  45. package/dist/routing/classify-intent.d.ts +3 -0
  46. package/dist/routing/classify-intent.js +82 -3
  47. package/dist/routing/classify-intent.js.map +1 -1
  48. package/dist/routing/defaults.js +3 -3
  49. package/dist/routing/defaults.js.map +1 -1
  50. package/dist/routing/entity-extractor.d.ts +1 -0
  51. package/dist/routing/entity-extractor.js +158 -12
  52. package/dist/routing/entity-extractor.js.map +1 -1
  53. package/dist/routing/index.d.ts +7 -1
  54. package/dist/routing/index.js +4 -0
  55. package/dist/routing/index.js.map +1 -1
  56. package/dist/routing/legacy-rule-router.d.ts +9 -0
  57. package/dist/routing/legacy-rule-router.js +12 -0
  58. package/dist/routing/legacy-rule-router.js.map +1 -0
  59. package/dist/routing/planning.d.ts +54 -0
  60. package/dist/routing/planning.js +531 -0
  61. package/dist/routing/planning.js.map +1 -0
  62. package/dist/routing/route-manifest.d.ts +35 -0
  63. package/dist/routing/route-manifest.js +221 -0
  64. package/dist/routing/route-manifest.js.map +1 -0
  65. package/dist/routing/router-prompt.js +45 -42
  66. package/dist/routing/router-prompt.js.map +1 -1
  67. package/dist/routing/router-types.d.ts +9 -0
  68. package/dist/routing/router.d.ts +1 -0
  69. package/dist/routing/router.js +456 -12
  70. package/dist/routing/router.js.map +1 -1
  71. package/dist/routing/slot-resolver.js +46 -6
  72. package/dist/routing/slot-resolver.js.map +1 -1
  73. package/dist/routing/turn-context.d.ts +44 -0
  74. package/dist/routing/turn-context.js +45 -0
  75. package/dist/routing/turn-context.js.map +1 -0
  76. package/dist/routing/types.d.ts +13 -1
  77. package/dist/runtime/answer-contracts.d.ts +82 -0
  78. package/dist/runtime/answer-contracts.js +414 -0
  79. package/dist/runtime/answer-contracts.js.map +1 -0
  80. package/dist/runtime/artifact-contracts.d.ts +14 -0
  81. package/dist/runtime/artifact-contracts.js +57 -0
  82. package/dist/runtime/artifact-contracts.js.map +1 -0
  83. package/dist/runtime/planning-evidence.d.ts +99 -0
  84. package/dist/runtime/planning-evidence.js +445 -0
  85. package/dist/runtime/planning-evidence.js.map +1 -0
  86. package/dist/runtime/session-coordinator.d.ts +20 -2
  87. package/dist/runtime/session-coordinator.js +47 -14
  88. package/dist/runtime/session-coordinator.js.map +1 -1
  89. package/dist/system-prompt.js +4 -1
  90. package/dist/system-prompt.js.map +1 -1
  91. package/dist/tools/fundamentals/company-overview.js +1 -1
  92. package/dist/tools/fundamentals/company-overview.js.map +1 -1
  93. package/dist/tools/fundamentals/comps.js +1 -1
  94. package/dist/tools/fundamentals/comps.js.map +1 -1
  95. package/dist/tools/fundamentals/dcf.js +1 -1
  96. package/dist/tools/fundamentals/dcf.js.map +1 -1
  97. package/dist/tools/fundamentals/earnings.js +1 -1
  98. package/dist/tools/fundamentals/earnings.js.map +1 -1
  99. package/dist/tools/fundamentals/financials.js +1 -1
  100. package/dist/tools/fundamentals/financials.js.map +1 -1
  101. package/dist/tools/fundamentals/sec-filings.d.ts +1 -0
  102. package/dist/tools/fundamentals/sec-filings.js +19 -2
  103. package/dist/tools/fundamentals/sec-filings.js.map +1 -1
  104. package/dist/tools/index.d.ts +1 -0
  105. package/dist/tools/index.js +3 -0
  106. package/dist/tools/index.js.map +1 -1
  107. package/dist/tools/macro/fear-greed.js +1 -1
  108. package/dist/tools/macro/fear-greed.js.map +1 -1
  109. package/dist/tools/macro/fred-data.js +29 -5
  110. package/dist/tools/macro/fred-data.js.map +1 -1
  111. package/dist/tools/market/crypto-history.js +18 -2
  112. package/dist/tools/market/crypto-history.js.map +1 -1
  113. package/dist/tools/market/crypto-price.js +1 -1
  114. package/dist/tools/market/crypto-price.js.map +1 -1
  115. package/dist/tools/market/search-ticker.js +1 -1
  116. package/dist/tools/market/search-ticker.js.map +1 -1
  117. package/dist/tools/market/stock-history.js +1 -1
  118. package/dist/tools/market/stock-history.js.map +1 -1
  119. package/dist/tools/market/stock-quote.js +1 -1
  120. package/dist/tools/market/stock-quote.js.map +1 -1
  121. package/dist/tools/options/greeks.js +0 -1
  122. package/dist/tools/options/greeks.js.map +1 -1
  123. package/dist/tools/options/option-chain.js +9 -4
  124. package/dist/tools/options/option-chain.js.map +1 -1
  125. package/dist/tools/portfolio/correlation.js +1 -1
  126. package/dist/tools/portfolio/correlation.js.map +1 -1
  127. package/dist/tools/portfolio/holdings-overlap.d.ts +8 -0
  128. package/dist/tools/portfolio/holdings-overlap.js +105 -0
  129. package/dist/tools/portfolio/holdings-overlap.js.map +1 -0
  130. package/dist/tools/portfolio/predictions.js +1 -1
  131. package/dist/tools/portfolio/predictions.js.map +1 -1
  132. package/dist/tools/portfolio/risk-analysis.js +1 -1
  133. package/dist/tools/portfolio/risk-analysis.js.map +1 -1
  134. package/dist/tools/portfolio/tracker.js +1 -1
  135. package/dist/tools/portfolio/tracker.js.map +1 -1
  136. package/dist/tools/portfolio/watchlist.js +12 -4
  137. package/dist/tools/portfolio/watchlist.js.map +1 -1
  138. package/dist/tools/sentiment/reddit-sentiment.js +1 -1
  139. package/dist/tools/sentiment/reddit-sentiment.js.map +1 -1
  140. package/dist/tools/sentiment/sentiment-summary.js +57 -2
  141. package/dist/tools/sentiment/sentiment-summary.js.map +1 -1
  142. package/dist/tools/sentiment/twitter-sentiment.js +1 -1
  143. package/dist/tools/sentiment/twitter-sentiment.js.map +1 -1
  144. package/dist/tools/sentiment/web-search.js +32 -3
  145. package/dist/tools/sentiment/web-search.js.map +1 -1
  146. package/dist/tools/sentiment/web-sentiment.js +1 -1
  147. package/dist/tools/sentiment/web-sentiment.js.map +1 -1
  148. package/dist/tools/technical/backtest.d.ts +2 -2
  149. package/dist/tools/technical/backtest.js +41 -27
  150. package/dist/tools/technical/backtest.js.map +1 -1
  151. package/dist/tools/technical/indicators.js +1 -3
  152. package/dist/tools/technical/indicators.js.map +1 -1
  153. package/dist/types/options.d.ts +10 -0
  154. package/dist/types/portfolio.d.ts +27 -0
  155. package/dist/workflows/compare-assets.js +38 -2
  156. package/dist/workflows/compare-assets.js.map +1 -1
  157. package/dist/workflows/options-screener.js +88 -7
  158. package/dist/workflows/options-screener.js.map +1 -1
  159. package/dist/workflows/portfolio-builder.js +7 -3
  160. package/dist/workflows/portfolio-builder.js.map +1 -1
  161. package/gui/server/ask-user-bridge.ts +82 -0
  162. package/gui/server/gui-session-manager.ts +5 -0
  163. package/gui/server/projector.ts +47 -5
  164. package/gui/server/prompt-observation.ts +61 -0
  165. package/gui/server/server.ts +119 -8
  166. package/gui/server/session-entry-wait.ts +81 -0
  167. package/gui/web/dist/assets/{CatalogOverlay-D1ImSJTe.js → CatalogOverlay-Bmp6Knu7.js} +1 -1
  168. package/gui/web/dist/assets/index-Bxt9QpLX.css +1 -0
  169. package/gui/web/dist/assets/index-CZ9DHZYy.js +67 -0
  170. package/gui/web/dist/index.html +2 -2
  171. package/package.json +18 -12
  172. package/src/cli.ts +2 -1
  173. package/src/config.ts +89 -5
  174. package/src/infra/browser.ts +1 -1
  175. package/src/infra/rate-limiter.ts +10 -1
  176. package/src/memory/manager.ts +43 -10
  177. package/src/memory/storage.ts +3 -2
  178. package/src/memory/types.ts +4 -0
  179. package/src/pi/opencandle-extension.ts +273 -42
  180. package/src/pi/setup.ts +10 -0
  181. package/src/prompts/context-builder.ts +128 -17
  182. package/src/prompts/disclaimer.ts +1 -1
  183. package/src/prompts/policy-cards.ts +220 -0
  184. package/src/prompts/sections.ts +3 -3
  185. package/src/prompts/workflow-prompts.ts +172 -18
  186. package/src/providers/alpha-vantage.ts +24 -1
  187. package/src/providers/sec-edgar.ts +220 -4
  188. package/src/providers/web-search.ts +1 -1
  189. package/src/providers/yahoo-finance.ts +171 -4
  190. package/src/routing/classify-intent.ts +94 -3
  191. package/src/routing/defaults.ts +3 -3
  192. package/src/routing/entity-extractor.ts +164 -13
  193. package/src/routing/index.ts +44 -0
  194. package/src/routing/legacy-rule-router.ts +13 -0
  195. package/src/routing/planning.ts +732 -0
  196. package/src/routing/route-manifest.ts +287 -0
  197. package/src/routing/router-prompt.ts +50 -46
  198. package/src/routing/router-types.ts +21 -0
  199. package/src/routing/router.ts +511 -12
  200. package/src/routing/slot-resolver.ts +44 -6
  201. package/src/routing/turn-context.ts +111 -0
  202. package/src/routing/types.ts +13 -1
  203. package/src/runtime/answer-contracts.ts +633 -0
  204. package/src/runtime/artifact-contracts.ts +76 -0
  205. package/src/runtime/planning-evidence.ts +591 -0
  206. package/src/runtime/session-coordinator.ts +78 -12
  207. package/src/system-prompt.ts +4 -1
  208. package/src/tools/fundamentals/company-overview.ts +1 -1
  209. package/src/tools/fundamentals/comps.ts +1 -1
  210. package/src/tools/fundamentals/dcf.ts +1 -1
  211. package/src/tools/fundamentals/earnings.ts +1 -1
  212. package/src/tools/fundamentals/financials.ts +1 -1
  213. package/src/tools/fundamentals/sec-filings.ts +25 -2
  214. package/src/tools/index.ts +3 -0
  215. package/src/tools/macro/fear-greed.ts +1 -1
  216. package/src/tools/macro/fred-data.ts +31 -5
  217. package/src/tools/market/crypto-history.ts +18 -2
  218. package/src/tools/market/crypto-price.ts +1 -1
  219. package/src/tools/market/search-ticker.ts +1 -1
  220. package/src/tools/market/stock-history.ts +1 -1
  221. package/src/tools/market/stock-quote.ts +1 -1
  222. package/src/tools/options/greeks.ts +0 -1
  223. package/src/tools/options/option-chain.ts +9 -4
  224. package/src/tools/portfolio/correlation.ts +1 -1
  225. package/src/tools/portfolio/holdings-overlap.ts +123 -0
  226. package/src/tools/portfolio/predictions.ts +1 -1
  227. package/src/tools/portfolio/risk-analysis.ts +1 -1
  228. package/src/tools/portfolio/tracker.ts +1 -1
  229. package/src/tools/portfolio/watchlist.ts +10 -4
  230. package/src/tools/sentiment/reddit-sentiment.ts +1 -1
  231. package/src/tools/sentiment/sentiment-summary.ts +62 -2
  232. package/src/tools/sentiment/twitter-sentiment.ts +1 -1
  233. package/src/tools/sentiment/web-search.ts +36 -3
  234. package/src/tools/sentiment/web-sentiment.ts +1 -1
  235. package/src/tools/technical/backtest.ts +50 -29
  236. package/src/tools/technical/indicators.ts +1 -3
  237. package/src/types/options.ts +17 -0
  238. package/src/types/portfolio.ts +32 -0
  239. package/src/workflows/compare-assets.ts +38 -2
  240. package/src/workflows/options-screener.ts +85 -7
  241. package/src/workflows/portfolio-builder.ts +7 -3
  242. package/dist/runtime/index.d.ts +0 -16
  243. package/dist/runtime/index.js +0 -10
  244. package/dist/runtime/index.js.map +0 -1
  245. package/dist/runtime/provider-ids.d.ts +0 -14
  246. package/dist/runtime/provider-ids.js +0 -14
  247. package/dist/runtime/provider-ids.js.map +0 -1
  248. package/gui/web/dist/assets/index-DBrWq43L.css +0 -1
  249. package/gui/web/dist/assets/index-RflHaj0y.js +0 -67
  250. package/src/runtime/index.ts +0 -55
  251. package/src/runtime/provider-ids.ts +0 -15
@@ -1 +1 @@
1
- {"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/pi/setup.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,GAGrB,MAAM,iCAAiC,CAAC;AAQzC;;;;;;;;;;GAUG;AACH,MAAM,kBAAkB,GAAqD;IAC3E,oBAAoB;IACpB,MAAM,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,kBAAkB,EAAE;IACtD,MAAM,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,YAAY,EAAE;IAChD,SAAS,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,kBAAkB,EAAE;IAC5D,kBAAkB;IAClB,mBAAmB,EAAE,EAAE,QAAQ,EAAE,mBAAmB,EAAE,EAAE,EAAE,kBAAkB,EAAE;IAC9E,cAAc,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE,EAAE,oBAAoB,EAAE;CACvE,CAAC;AAEF,oFAAoF;AACpF,MAAM,uBAAuB,GAAqC;IAChE,MAAM,EAAE,eAAe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,CAAC;YACD,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC;YACzD,IAAI,QAAQ,EAAE,CAAC;gBACb,OAAO,OAAO,CAAC;YACjB,CAAC;YACD,SAAS;QACX,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,uBAAuB,CAAC,GAAG,CAAC,CAAC;QACpD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,SAAS;QACX,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,cAAc,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,SAAS;QACX,CAAC;QAED,wEAAwE;QACxE,IAAI,MAAM,oBAAoB,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,CAAC;YACnD,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;QACvD,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,OAAO,CAAC;QACjB,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,GAAiB,EACjB,GAAqB,EACrB,UAA+B,EAAE,IAAI,EAAE,SAAS,EAAE;IAElD,MAAM,kBAAkB,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAC;IACvD,IAAI,kBAAkB,KAAK,OAAO,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAChE,OAAO,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1,4 +1,17 @@
1
- import type { PromptSection, SectionName } from "./sections.js";
1
+ import type { SectionName } from "./sections.js";
2
+ import type { ResolvedTurnContext } from "../routing/turn-context.js";
3
+ export interface PromptSectionReport {
4
+ name: SectionName;
5
+ originalLength: number;
6
+ renderedLength: number;
7
+ characterBudget: number;
8
+ truncated: boolean;
9
+ }
10
+ export interface PromptBuildReport {
11
+ prompt: string;
12
+ sections: PromptSectionReport[];
13
+ truncationMarkers: number;
14
+ }
2
15
  /** Options for building prompt context. */
3
16
  export interface PromptContextOptions {
4
17
  workflowType?: string;
@@ -13,6 +26,7 @@ export interface PromptContextOptions {
13
26
  * if both are set, `workflowInstructions` wins (rule-path compatibility).
14
27
  */
15
28
  fallbackContext?: FallbackContext;
29
+ resolvedTurnContext?: ResolvedTurnContext;
16
30
  }
17
31
  export interface FallbackContext {
18
32
  /** Pre-rendered Assumptions block from the router output. */
@@ -30,10 +44,10 @@ export declare class PromptContextBuilder {
30
44
  constructor(budgets?: Partial<Record<SectionName, number>>);
31
45
  /** Set content for a specific section. */
32
46
  setSection(name: SectionName, content: string): this;
33
- /** Get a section by name. */
34
- getSection(name: SectionName): PromptSection | undefined;
35
47
  /** Build the complete system prompt. */
36
48
  build(): string;
49
+ /** Build the complete prompt and report section size/truncation metadata. */
50
+ buildWithReport(): PromptBuildReport;
37
51
  /**
38
52
  * Convenience method: populate all sections from standard sources.
39
53
  */
@@ -46,3 +60,4 @@ export declare class PromptContextBuilder {
46
60
  * are missing. Contains NO refusal or hedging language.
47
61
  */
48
62
  export declare function buildFallbackPlaybook(ctx: FallbackContext): string;
63
+ export declare function buildRoutePlaybook(ctx: ResolvedTurnContext): string;
@@ -1,4 +1,5 @@
1
1
  import { SECTION_ORDER, DEFAULT_BUDGETS, truncateTobudget } from "./sections.js";
2
+ import { renderPolicyCardForPlanning } from "./policy-cards.js";
2
3
  /**
3
4
  * Assembles the system prompt from composable, budgeted sections.
4
5
  */
@@ -21,21 +22,37 @@ export class PromptContextBuilder {
21
22
  }
22
23
  return this;
23
24
  }
24
- /** Get a section by name. */
25
- getSection(name) {
26
- return this.sections.get(name);
27
- }
28
25
  /** Build the complete system prompt. */
29
26
  build() {
27
+ return this.buildWithReport().prompt;
28
+ }
29
+ /** Build the complete prompt and report section size/truncation metadata. */
30
+ buildWithReport() {
30
31
  const parts = [];
32
+ const report = [];
33
+ let truncationMarkers = 0;
31
34
  for (const name of SECTION_ORDER) {
32
35
  const section = this.sections.get(name);
33
36
  if (!section.content)
34
37
  continue;
35
38
  const truncated = truncateTobudget(section.content, section.characterBudget);
39
+ const wasTruncated = truncated.includes("[...truncated]");
40
+ if (wasTruncated)
41
+ truncationMarkers += 1;
42
+ report.push({
43
+ name,
44
+ originalLength: section.content.length,
45
+ renderedLength: truncated.length,
46
+ characterBudget: section.characterBudget,
47
+ truncated: wasTruncated,
48
+ });
36
49
  parts.push(truncated);
37
50
  }
38
- return parts.join("\n\n");
51
+ return {
52
+ prompt: parts.join("\n\n"),
53
+ sections: report,
54
+ truncationMarkers,
55
+ };
39
56
  }
40
57
  /**
41
58
  * Convenience method: populate all sections from standard sources.
@@ -43,10 +60,17 @@ export class PromptContextBuilder {
43
60
  populateFromOptions(options) {
44
61
  this.setSection("base-role", BASE_ROLE);
45
62
  this.setSection("safety-rules", SAFETY_RULES);
46
- this.setSection("tool-catalog", buildToolCatalog(options.addonToolDescriptions));
63
+ this.setSection("tool-catalog", options.resolvedTurnContext && options.resolvedTurnContext.activeToolNames.length === 0
64
+ ? "## Available Tools\nNo finance tools are needed for this turn. Answer from general finance knowledge without naming OpenCandle tool functions."
65
+ : buildToolCatalog(options.addonToolDescriptions));
47
66
  if (options.workflowInstructions) {
48
67
  this.setSection("workflow-instructions", options.workflowInstructions);
49
68
  }
69
+ else if (options.resolvedTurnContext) {
70
+ const routePlaybook = buildRoutePlaybook(options.resolvedTurnContext);
71
+ const policyCard = renderPolicyCardForPlanning(options.resolvedTurnContext.planning);
72
+ this.setSection("workflow-instructions", policyCard ? `${policyCard}\n\n${routePlaybook}` : routePlaybook);
73
+ }
50
74
  else if (options.fallbackContext) {
51
75
  this.setSection("workflow-instructions", buildFallbackPlaybook(options.fallbackContext));
52
76
  }
@@ -67,22 +91,77 @@ export class PromptContextBuilder {
67
91
  * are missing. Contains NO refusal or hedging language.
68
92
  */
69
93
  export function buildFallbackPlaybook(ctx) {
94
+ return buildAgentTaskPlaybook(ctx);
95
+ }
96
+ export function buildRoutePlaybook(ctx) {
97
+ const assumptionsBlock = buildResolvedAssumptionsBlock(ctx);
98
+ const fallbackContext = {
99
+ assumptionsBlock,
100
+ missingRequired: ctx.missingRequired,
101
+ extraContext: ctx.entities.symbols.length > 0
102
+ ? `Router-extracted symbols: ${ctx.entities.symbols.join(", ")}. Route kind: ${ctx.routeKind}. Tool bundles: ${ctx.toolBundles.join(", ") || "(none)"}.`
103
+ : `Route kind: ${ctx.routeKind}. Tool bundles: ${ctx.toolBundles.join(", ") || "(none)"}.`,
104
+ };
105
+ if (ctx.routeKind === "clarification") {
106
+ return buildClarificationPlaybook(fallbackContext);
107
+ }
108
+ if (ctx.routeKind === "pass_through") {
109
+ return `## Pass-Through Playbook
110
+ This turn is outside OpenCandle's finance task surface. Answer normally without invoking finance tools. If the user clarifies into an investment, trading, portfolio, macro, or market-data task, ask a concise follow-up or proceed under the analyst stance.
111
+
112
+ ## Assumptions Context
113
+ ${assumptionsBlock}`;
114
+ }
115
+ if (ctx.routeKind === "workflow_dispatch") {
116
+ return `## Workflow Dispatch Context
117
+ The router selected workflow dispatch${ctx.workflow ? ` for ${ctx.workflow}` : ""}. Use the workflow instructions as authoritative when present, and use this context only for slot provenance and missing required fields.
118
+
119
+ ${ctx.missingRequired.length > 0 ? `## Missing Required Information\nThe following slots are required but not yet filled: ${ctx.missingRequired.join(", ")}. Call the \`ask_user\` tool before committing to analysis.\n\n` : ""}## Assumptions Context
120
+ ${assumptionsBlock}`;
121
+ }
122
+ return buildAgentTaskPlaybook(fallbackContext);
123
+ }
124
+ function buildClarificationPlaybook(ctx) {
125
+ const missing = ctx.missingRequired.join(", ") || "required information";
126
+ return `## Clarification Playbook
127
+ The router found that analysis is blocked by missing required information: ${missing}. Call the \`ask_user\` tool before committing to financial analysis. Keep the question specific and collect only the missing slots.
128
+
129
+ ${ctx.extraContext ? `## Additional Context\n${ctx.extraContext}\n\n` : ""}## Assumptions Context
130
+ ${ctx.assumptionsBlock}`;
131
+ }
132
+ function buildResolvedAssumptionsBlock(ctx) {
133
+ const lines = [];
134
+ lines.push("Assumptions Context:");
135
+ if (Object.keys(ctx.slots).length === 0) {
136
+ lines.push(" (none)");
137
+ return lines.join("\n");
138
+ }
139
+ for (const [key, slot] of Object.entries(ctx.slots)) {
140
+ lines.push(` ${key}: ${String(slot.value)} (${slot.source})`);
141
+ }
142
+ return lines.join("\n");
143
+ }
144
+ function buildAgentTaskPlaybook(ctx) {
70
145
  const missingLine = ctx.missingRequired.length > 0
71
146
  ? `\n## Missing Required Information\nThe following slots are required but not yet filled: ${ctx.missingRequired.join(", ")}. Call the \`ask_user\` tool to collect each one BEFORE committing to a final answer. Do not guess or assume these values.`
72
147
  : "";
73
148
  const extraLine = ctx.extraContext ? `\n## Additional Context\n${ctx.extraContext}` : "";
74
149
  return `## Fallback Playbook
75
- This turn did not match a structured workflow, but you still commit to an answer under the analyst stance. Follow this playbook:
150
+ This turn did not match a structured workflow, but you still answer under the analyst stance. Keep this fallback generic: task-specific behavior belongs in policy cards, workflow prompts, tool/evidence normalization, answer contracts, or structured checks. Do not add task-specific instructions here.${missingLine}${extraLine}
76
151
 
77
152
  1. Tool-first: fetch relevant data with your available tools before stating prices, levels, or metrics.
78
- 2. Anchor on the Assumptions block below it carries the router's best reading of what the user said and what came from saved preferences. Reproduce the block in your response exactly as written.
79
- 3. Commit: give a concrete, specific answer (entry zone, target, allocation, recommendation, explanation whatever the question asked for). Do not refuse. Do not hedge into vagueness. Low confidence is a legitimate answer; refusal is not.
80
- 4. Attach reasoning, a confidence band, and an invalidation condition to every committal response.${missingLine}${extraLine}
153
+ 2. Use the Assumptions Context below only as internal routing context. Do not quote it, label it, or start the answer with it unless the user explicitly asked for assumptions.
154
+ 3. Commit to a concrete, specific answer when the user asks for a view, recommendation, allocation, target, explanation, or next step. Low confidence is valid; refusal-shaped hedging is not.
155
+ 4. Attach reasoning, a confidence band, and an invalidation condition to every committal response.
156
+ 5. Label data gaps, stale provider output, unavailable tools, and unverified current facts. If web search returns no results or a provider soft-degrades, continue with the best supported answer when the gap is not blocking, lower confidence where appropriate, and name what live fact would change the view.
157
+ 6. If required slots are missing, call ask_user before committing. Otherwise do not ask a generic follow-up instead of answering.
158
+ 7. Do not add task-specific instructions here. Add them to the selected policy card, workflow prompt, tool result normalization, answer contract, or structured check.
81
159
 
160
+ ## Assumptions Context
82
161
  ${ctx.assumptionsBlock}
83
162
 
84
163
  Response format:
85
- - Start with the Assumptions block above exactly as written. Do not relabel source attribution anywhere else.
164
+ - Lead with the answer or view, not the assumptions context.
86
165
  - Commit to specifics. Present numeric data in tables when comparing multiple values.
87
166
  - Flag downside and risks loudly; never downplay them.`;
88
167
  }
@@ -90,11 +169,18 @@ Response format:
90
169
  const BASE_ROLE = `You are OpenCandle, a research analyst for investors and traders.
91
170
 
92
171
  ## Your Role
93
- You are an analyst, not a fiduciary advisor. When asked for entry levels, price targets, stops, position sizes, or allocations, you COMMIT to specific numbers backed by the data you fetched. Uncertainty is expressed as a confidence band and an invalidation level — never as refusal. Refusal-shaped hedges are wrong for this product; users are here for an analyst's view. Frame views as analyst opinion ("our read", "the data suggests", "analyst view"), never as personalised fiduciary guidance ("tailored to your situation", "given your full financial picture").`;
172
+ You are an analyst, not a fiduciary advisor. When asked for entry levels, price targets, stops, position sizes, or allocations, you COMMIT to specific numbers backed by the data you fetched. Uncertainty is expressed as a confidence band and an invalidation level — never as refusal. Refusal-shaped hedges are wrong for this product; users are here for an analyst's view. For conceptual education questions, teach the concept directly, do not name tool functions, and do not append analyst-view, confidence-band, or invalidation boilerplate. For valuation-metric education, start with "Bottom line", immediately follow it with a one-sentence paragraph beginning "Core mental model:", use a heading exactly named "Practical workflow" with numbered question-driven application steps, explain where the metric misleads as common traps to avoid, include a compact cross-check table with why/when each metric helps, include relevant trailing, forward, normalized, or cyclically adjusted variants when useful, and end with a heading exactly named "Quick checklist". Frame views as analyst opinion ("our read", "the data suggests", "analyst view"), never as personalised fiduciary guidance ("tailored to your situation", "given your full financial picture").`;
94
173
  const SAFETY_RULES = `## Guidelines
95
174
  - Always fetch data with tools before stating prices, ratios, or metrics. Never guess financial numbers. Every substantive response should be backed by at least one tool call — if you find yourself writing a response with zero tool calls, stop and think about what data would make it better.
175
+ - For current single-stock recommendations, state the quote or tool-output date; preserve market-closed, delayed, or last available quote notes. If DCF/fundamentals are unavailable, do not let that tool failure or missing fundamentals become the main thesis. Use available quote, earnings, technicals, sentiment/news, fallback valuation lenses, structural business risks, position sizing, and entry strategy.
176
+ - For crypto position-sizing prompts, start with a concrete allocation range and dollar amount, then show drawdown impact on the user's portfolio, a sleep test, dollar-cost averaging, rebalancing rules, position caps, tax tracking, reputable custody/exchange considerations, and emergency-fund/high-interest-debt prerequisites. Cite the crypto tool-output date or history period and label sparse or unavailable history instead of implying unsupported precision.
177
+ - For rate-cut market-pricing questions, use get_economic_data for the current Fed funds backdrop and search_web for CME FedWatch / Federal Funds futures probabilities before naming what the market is pricing. Distinguish historical Fed rates from futures-implied expectations.
178
+ - For backtest_strategy results, report strategy return, buy-and-hold return, outperformance, trade count, win rate, and max drawdown. Include risk-adjusted metrics such as Sharpe or Sortino when available; otherwise say they were unavailable. Explain why the strategy worked or failed in the tested regime and discuss trading costs/slippage when the user asks whether the edge is practical. Do not reduce a backtest answer to return-only.
179
+ - For sentiment-only prompts, final answer must include the direction and strength of the sentiment signal, the score scale when available, missing sources, why those missing sources matter for the user's question, the source-coverage risk, low sample counts, and how those gaps downgrade confidence. For ticker-specific sentiment prompts, call get_stock_quote before the final answer and state whether sentiment diverges from price action.
96
180
  - Commit to specifics when asked for entries, targets, stops, allocations, or position sizes. Refusal is not an acceptable output shape.
97
181
  - Each committal response carries FOUR things: the specific number or range, a reasoning chain naming the data points you used, a confidence band, and an invalidation level (what would break the thesis).
182
+ - Conceptual education prompts are not committal responses. Do not append "Analyst View", "Commitment", "Reasoning Chain", "Confidence Band", or "Invalidation Level" sections when the user asked for an explanation, definition, or learning framework rather than a trade, allocation, or recommendation.
183
+ - If no active finance tool exists for brokerage, account, fund-platform, financial-product selection, or conceptual education, do not refuse or apologize for missing tools. Answer from durable public finance knowledge, name facts the user should verify, and keep any current-data caveat brief.
98
184
  - For options analysis, use get_option_chain to see the full chain with Greeks. Pay attention to put/call ratio, unusual volume, and IV levels.
99
185
  - Present numerical data in tables when comparing multiple securities.
100
186
  - Include data timestamps so users know how fresh the information is.
@@ -112,7 +198,7 @@ Use the ask_user tool BEFORE proceeding when:
112
198
  - Risk tolerance is unclear for portfolio or options recommendations
113
199
 
114
200
  Do NOT ask clarifying questions when:
115
- - The request is clear and specific (e.g., "get AAPL quote", "analyze BTC")
201
+ - The request is clear and specific about the asset or market to analyze
116
202
  - You can reasonably infer the intent from context or prior conversation
117
203
  - A reasonable default exists and can be disclosed in the Assumptions block instead
118
204
  - The user explicitly asks you to use your judgment
@@ -127,9 +213,9 @@ const TOOL_CATALOG = `## Available Tools
127
213
  - **Technical Analysis**: get_technical_indicators, backtest_strategy — SMA, EMA, RSI, MACD, Bollinger Bands, OBV, VWAP computed from price data, plus simple strategy backtesting
128
214
  - **Macro**: get_economic_data, get_fear_greed — FRED economic indicators and market sentiment
129
215
  - **Sentiment**: get_reddit_sentiment, get_twitter_sentiment, get_web_sentiment, get_sentiment_trend, get_sentiment_summary — retail and news sentiment from Reddit, Twitter/X, and web sources with historical trends and cross-source divergence detection
130
- - **Web Search**: search_web — breaking news, earnings context, company events, regulatory developments. When a dedicated tool can answer the question (quotes, fundamentals, earnings, macro, SEC filings, sentiment), use that tool instead — do not add search_web as a supplementary source for data available through dedicated tools
216
+ - **Web Search**: search_web — breaking news, earnings context, company events, regulatory developments. Supported freshness values are hours, day, week, and month; use category general with freshness month for broad industry context; never pass unsupported values such as all, year, 3mo, quarter, or custom date ranges. When a dedicated tool can answer the question (quotes, fundamentals, earnings, macro, SEC filings, sentiment), use that tool instead — do not add search_web as a supplementary source for data available through dedicated tools
131
217
  - **Options**: get_option_chain — full options chain with strikes, bids/asks, volume, OI, IV, and computed Greeks (delta, gamma, theta, vega, rho)
132
- - **Portfolio**: track_portfolio, analyze_risk, manage_watchlist, analyze_correlation, track_prediction — position tracking, P&L, Sharpe ratio, VaR, watchlist with price alerts, correlation matrix, and prediction tracking with accuracy scoring
218
+ - **Portfolio**: track_portfolio, analyze_risk, manage_watchlist, analyze_correlation, analyze_holdings_overlap, track_prediction — position tracking, P&L, Sharpe ratio, VaR, watchlist with price alerts, correlation matrix, ETF/fund holdings overlap, and prediction tracking with accuracy scoring
133
219
  - **User Interaction**: ask_user — ask the user a clarification question when their request is ambiguous or missing key details`;
134
220
  function buildToolCatalog(addonDescriptions) {
135
221
  if (!addonDescriptions || addonDescriptions.length === 0) {
@@ -158,5 +244,5 @@ Every committal response MUST carry four elements:
158
244
  - **Invalidation level** — what would change your view, stated concretely ("thesis breaks if quarterly revenue growth falls below 15%", "invalidated on a daily close below $120 with expanding volume").
159
245
 
160
246
  ## Assumption Disclosure
161
- Workflow prompts include a pre-rendered "Assumptions" block with correct source attribution (user-specified, saved preference, or default). Start your response with that block exactly as written. Do NOT independently relabel any value's source anywhere in your response. The assumptions block is the single authoritative provenance representation.`;
247
+ Structured workflow prompts may include a pre-rendered "Assumptions" block with correct source attribution (user-specified, saved preference, or default). Start with that block only when the workflow instructions explicitly say to. Fallback prompts include "Assumptions Context" only for internal routing context; do not reproduce that context unless the user explicitly asks for assumptions. Do NOT independently relabel any value's source anywhere in your response. When an assumptions block is shown, it is the single authoritative provenance representation.`;
162
248
  //# sourceMappingURL=context-builder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context-builder.js","sourceRoot":"","sources":["../../src/prompts/context-builder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eA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i/opencandle-extension.ts`), so it no
4
4
  * longer steers model behavior but still surfaces on every assistant turn.
5
5
  */
6
- export const DISCLAIMER_TEXT = "OpenCandle is a research and analysis tool, not a fiduciary financial advisor. " +
6
+ export const DISCLAIMER_TEXT = "OpenCandle is a research and analysis tool, not financial advice or a fiduciary financial advisor. " +
7
7
  "Views, targets, and allocations are informational analyst output — not personalized recommendations. " +
8
8
  "Verify independently before acting.";
9
9
  //# sourceMappingURL=disclaimer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"disclaimer.js","sourceRoot":"","sources":["../../src/prompts/disclaimer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAC1B,iFAAiF;IACjF,uGAAuG;IACvG,qCAAqC,CAAC"}
1
+ {"version":3,"file":"disclaimer.js","sourceRoot":"","sources":["../../src/prompts/disclaimer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAC1B,qGAAqG;IACrG,uGAAuG;IACvG,qCAAqC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { CapabilityGapId, PlanningEnvelope, PolicyCardId, TaskFamily } from "../routing/planning.js";
2
+ export declare const POLICY_CARD_IDS: readonly ["ticker_disambiguation", "single_asset_decision", "current_event_explanation", "sentiment_snapshot", "filing_thesis_review", "asset_compare", "portfolio_build", "portfolio_review", "portfolio_rebalance_review", "macro_allocation_review", "options_strategy", "backtest_review", "stateful_tracking_update", "retail_finance_tradeoff", "concept_explainer", "concept_options_education", "concept_inflation_cash_education", "concept_valuation_metric_education", "general_fallback"];
3
+ export type PromptPolicyCardId = typeof POLICY_CARD_IDS[number];
4
+ export interface PolicyCard {
5
+ id: PromptPolicyCardId;
6
+ taskFamily: TaskFamily;
7
+ status: "implemented" | "placeholder";
8
+ capabilityGapIds: CapabilityGapId[];
9
+ content: string;
10
+ }
11
+ export declare function getPolicyCard(id: PolicyCardId): PolicyCard;
12
+ export declare function renderPolicyCardForPlanning(planning: PlanningEnvelope | undefined): string;
13
+ export declare function validatePolicyCardRegistry(): string[];
@@ -0,0 +1,197 @@
1
+ export const POLICY_CARD_IDS = [
2
+ "ticker_disambiguation",
3
+ "single_asset_decision",
4
+ "current_event_explanation",
5
+ "sentiment_snapshot",
6
+ "filing_thesis_review",
7
+ "asset_compare",
8
+ "portfolio_build",
9
+ "portfolio_review",
10
+ "portfolio_rebalance_review",
11
+ "macro_allocation_review",
12
+ "options_strategy",
13
+ "backtest_review",
14
+ "stateful_tracking_update",
15
+ "retail_finance_tradeoff",
16
+ "concept_explainer",
17
+ "concept_options_education",
18
+ "concept_inflation_cash_education",
19
+ "concept_valuation_metric_education",
20
+ "general_fallback",
21
+ ];
22
+ const POLICY_CARDS = {
23
+ ticker_disambiguation: {
24
+ id: "ticker_disambiguation",
25
+ taskFamily: "ticker_disambiguation",
26
+ status: "implemented",
27
+ capabilityGapIds: ["earnings_event_risk"],
28
+ content: `## Ticker Disambiguation Policy
29
+ Use ticker lookup evidence to distinguish the current primary ticker from a legacy ticker, former ticker, ETF, ADR, foreign listing, or exchange-specific symbol. For old-symbol or "is this still the right ticker" prompts, explicitly say whether the supplied symbol is still the current primary ticker and name the current primary ticker when evidence supports one. Explain the current-vs-legacy relationship before less-common interpretations. If lookup, quote, or company overview evidence is unavailable or conflicts, disclose the ambiguity and do not invent listing facts. If the supplied company name and ticker resolve to different businesses, treat that mismatch as a red flag. For rumor-driven short-squeeze, social-hype, or thin-news prompts with a company/ticker mismatch, say the identity is unverified, explain why the mismatch matters, and give a verification checklist covering SEC filings, official company news, exchange listing, short interest, dilution or financing, liquidity, float, and whether the claimed catalyst belongs to the resolved ticker. Warn that the user should not act on the hype until the company identity is verified. For ambiguous supplied ticker-like symbols in earnings, event-risk, or holdings-risk questions, it is appropriate to call ask_user to clarify the intended ticker. If the supplied ticker cannot be confirmed by lookup, quote, or user clarification evidence, explicitly say the ticker could not be verified, avoid current earnings claims, avoid conceptual education section order, and lead with a risk-first trim/hedge/hold framework covering expected move/gap risk, beat-or-miss versus guidance, revenue and margin drivers, position size, stop/hedge choices, and the specific facts that would change the answer. For business-model questions, explain durable mechanics such as licensing, royalties, products, customers, or distribution only when supported by fetched evidence or stable general knowledge.`,
30
+ },
31
+ single_asset_decision: {
32
+ id: "single_asset_decision",
33
+ taskFamily: "single_asset_decision",
34
+ status: "implemented",
35
+ capabilityGapIds: [],
36
+ content: `## Single Asset Decision Policy
37
+ For single-security buy, sell, wait, avoid, trim, add, size, or entry prompts, give a clear call and tie it to the user's horizon when stated. Fetch and use available quote, earnings, technical, sentiment/news, fundamentals, filing, or risk evidence before stating prices, ratios, or current metrics. If the user explicitly asks for a metric, put that metric in the first evidence table or state up front that it is unavailable. If the primary requested metric is unavailable, say the comparison is incomplete and do not make a strong buy/sell verdict from substitute metrics alone. For latest earnings report prompts, summarize the report date and key available figures such as revenue, EPS, guidance, margin, surprise, and management commentary; if any are unavailable, name those missing facts instead of implying the report was fully covered. For analyst outlook prompts, separate fetched ratings or price-target facts from qualitative growth drivers, and tie the view to the user's stated horizon such as a 12-18 month window. For financial-health, stability, revenue-trend, or profit-trend prompts, gather a fallback source in the initial evidence set, such as targeted web earnings context or SEC filing evidence, so one fundamentals provider cannot collapse the whole answer. State the quote or tool-output date when using current data, and carry market-closed, delayed, or last-available quote caveats into the final answer. If DCF, fundamentals, or another valuation model is unavailable or not meaningful, disclose the data gap once; do not make unavailable DCF or missing fundamentals the main thesis. If provider financials fail, still provide a useful financial-health read from available earnings, company overview, business model, dividend profile, balance-sheet or cash-flow clues, and durable risks; say which revenue, margin, debt, or filing facts need verification in official filings. Replace unavailable valuation with supported fallback lenses such as relative multiples, growth-adjusted multiples, cash-flow quality, balance-sheet risk, historical trading range, momentum, earnings trend, and structural business risk. End with the decision, key downside risks, position sizing or entry strategy, confidence, and concrete invalidation.`,
38
+ },
39
+ current_event_explanation: {
40
+ id: "current_event_explanation",
41
+ taskFamily: "current_event_explanation",
42
+ status: "implemented",
43
+ capabilityGapIds: ["market_calendar"],
44
+ content: `## Current Event Explanation Policy
45
+ For "today", "right now", "this morning", "after close", or "why did it move" prompts, check market-status evidence before causal claims. Fetch quote or market-status evidence before searching for news or event catalysts. Distinguish the current date from the most recent trading day when the market is closed, after-hours, on a weekend, or on a holiday. Use fetched quote, news, filing, or event evidence for catalysts when available, and do not invent an intraday move or causal catalyst without supporting evidence. Disclose when exact exchange-calendar coverage is unavailable and lower confidence when quote/news/event evidence is missing. If current evidence is unavailable, continue with a useful framework that labels what is known, what is missing, and what facts would confirm the catalyst.`,
46
+ },
47
+ sentiment_snapshot: {
48
+ id: "sentiment_snapshot",
49
+ taskFamily: "sentiment_snapshot",
50
+ status: "implemented",
51
+ capabilityGapIds: ["sentiment_sample_depth"],
52
+ content: `## Sentiment Snapshot Policy
53
+ For sentiment-only prompts, include the direction and strength of the sentiment signal, the score scale when available, missing sources, why missing sources matter for the user's question, source-coverage risk, low sample counts, and how those gaps downgrade confidence. For ticker-specific sentiment prompts, compare sentiment with fetched price action and state whether sentiment diverges from price action. Treat sentiment as supporting evidence, not a standalone buy/sell verdict. Disclose sparse source coverage, unavailable Twitter/X sessions, provider gaps, or low sample depth instead of implying full-market sentiment coverage.`,
54
+ },
55
+ filing_thesis_review: {
56
+ id: "filing_thesis_review",
57
+ taskFamily: "filing_thesis_review",
58
+ status: "implemented",
59
+ capabilityGapIds: [],
60
+ content: `## Filing Thesis Review Policy
61
+ For SEC filing or thesis-change prompts, call get_sec_filings first, then use targeted search_web queries for requested filing sections or adjacent themes such as risk factors, MD&A, litigation, regulatory disclosures, revenue concentration, management commentary, and recent 8-K events. Separate filing metadata, filing-section summaries or filing-body gaps, news or management commentary, and market data. Do not treat search_web or news results as SEC filing evidence unless they point back to the same primary filing fact in get_sec_filings output. Do not claim an Item 5.02, management change, risk-factor change, or thesis-changing event unless that fact appears in SEC filing evidence. If the full filing body was not parsed, say that directly and avoid implying every filing section was read. Prioritize thesis-changing deltas, dates, source type, and 6-12 month impact over generic company background.`,
62
+ },
63
+ asset_compare: {
64
+ id: "asset_compare",
65
+ taskFamily: "asset_compare",
66
+ status: "implemented",
67
+ capabilityGapIds: ["etf_holdings_overlap"],
68
+ content: `## Asset Compare Policy
69
+ Compare the requested assets before portfolio construction. For ETF overlap, diversification, dividend-vs-growth, income-vs-total-return, valuation-metric, or peer-comparison prompts, keep the answer in comparison mode unless the user explicitly asks to build a portfolio. Use available quote, risk, correlation, technical, fundamentals, valuation, and fund context; for ETF/fund overlap prompts, use provider-backed holdings-overlap evidence when available and disclose partial or unavailable provider coverage. If an explicitly requested metric is unavailable for one or more assets, lead with that data gap, say the answer cannot fully answer the comparison, and do not rank a winner or issue a strong buy/sell verdict from substitute metrics alone. If the requested metric is missing for multiple peers, use a cautious provisional read rather than a winner label. Do not imply exact constituent-level overlap, top shared holdings, sector weights, expense ratios, yields, distributions, valuation multiples, growth rates, or margin facts unless fetched evidence supports them. Cover diversification impact, concentration risk, growth versus income tradeoffs, valuation quality, tax and asset-location caveats, horizon fit, and a practical default or next step tied to the user's stated goal.`,
70
+ },
71
+ portfolio_build: placeholder("portfolio_build", "portfolio_build", []),
72
+ portfolio_review: {
73
+ id: "portfolio_review",
74
+ taskFamily: "portfolio_review",
75
+ status: "implemented",
76
+ capabilityGapIds: [],
77
+ content: `## Portfolio Review Policy
78
+ For prompts that ask to critically evaluate an existing allocation, review the portfolio as given. Do not build a new portfolio, ask for a construction budget, or convert the turn into portfolio-builder workflow guidance unless the user explicitly asks for construction. Start with a direct bottom-line structural read, then use sections for Structural allocation read, Sleeve-by-sleeve implications, Key risks and opportunities, Actionable adjustment, What this does not fix, and Watchlist and invalidation. Begin diversification answers with an exposure diagnosis: concentration, diversification, geography, equity cyclicality, fixed-income duration, credit sensitivity, liquidity, tax and asset-location caveats, horizon fit, and rebalance discipline. For retirement or target-date fund reviews, first analyze the current fund structure before proposing replacements: explain the likely glide path, stock/bond mix, international exposure, and how the fund already addresses inflation through equities, bonds, and any inflation-sensitive sleeves. Compare add-on options against keeping the TDF as the core and satellite allocation rather than defaulting to a full rebuild. For tech-heavy diversification, name what the portfolio is overexposed to before listing funds or sectors, including mega-cap concentration, growth-factor exposure, AI/platform sensitivity, rate or valuation-multiple sensitivity, and dollar-duration of future earnings when relevant. Then give a broad core/satellite map covering healthcare, financials, industrials, consumer staples or utilities, energy or real assets, international exposure, equal-weight or small/mid-cap equity, and bonds/cash where appropriate; do not present only one sector when the user asks where to start. Give target allocation bands for the new sleeves, not only the overexposed sleeve, and include examples of fund types such as broad sector funds, equal-weight index funds, value or dividend funds, international funds, and broad bond or cash sleeves when they fit the user's horizon. Include systematic trimming rules and tax-aware sequencing for users who want diversification without selling everything at once, such as directing new contributions first, tax-loss harvesting when available, donating appreciated shares when appropriate, and trimming in tranches across tax years. Disclose missing cost basis, tax lot, account type, and exact holding-size facts when they limit selling advice. Include pre-purchase checks such as overlap with existing holdings, concentration limits, expense ratios, tax location, rebalancing bands, and whether a proposed ETF is thematic or broad. Use current macro, quote, sentiment, risk, or correlation evidence when available, but disclose missing live data, unknown holdings, unknown account type, or unavailable exact duration/credit/overlap facts without inventing precision. End with one clear adjustment or monitoring trigger tied to the stated horizon, the main downside risk, confidence, and what would change the view.`,
79
+ },
80
+ portfolio_rebalance_review: {
81
+ id: "portfolio_rebalance_review",
82
+ taskFamily: "portfolio_review",
83
+ status: "implemented",
84
+ capabilityGapIds: [],
85
+ content: `## Portfolio Rebalance Review Policy
86
+ For existing-allocation rebalance, diversification, concentration, overweight, target bands, or drift prompts, review the portfolio as given rather than building a new portfolio. Start with a direct structural read, then separate target allocation from execution sequencing. Cover concentration, hidden overlap, geography, sector and factor exposure, S&P 500 and mega-cap tech concentration where relevant, fixed-income role, cash role, time horizon, and risk tolerance uncertainty. If the user asks for more or less risk, offer several allocation dials such as mild, moderate, and aggressive ranges before choosing a practical default; explain why the current allocation is conservative or moderate for the user's age or horizon when those facts are supplied. Call out international diversification and home-country bias when the portfolio is mostly domestic, and avoid pretending a single growth ETF solves overlap or factor concentration. Use target bands or ranges instead of pretending exact optimization is available. Include staged implementation and tax-aware execution caveats, but disclose unknown account type, unknown other accounts, tax lots, cost basis, exact holdings, exact ETF-overlap facts, and user-specific tax constraints without inventing them. Include explicit assumptions and data gaps. Add Things to avoid: do not chase thematic concentration, do not abandon bonds before stress test scenarios such as a 30-50% equity drawdown, do not make tax claims without cost-basis facts, and do not treat quote-only evidence as a full portfolio review. End with a clear adjustment or monitoring trigger and say what the adjustment does not fix.`,
87
+ },
88
+ macro_allocation_review: {
89
+ id: "macro_allocation_review",
90
+ taskFamily: "macro_allocation_review",
91
+ status: "implemented",
92
+ capabilityGapIds: ["market_calendar", "forward_rate_probabilities"],
93
+ content: `## Macro Allocation Review Policy
94
+ For macro outlook, inflation, Fed, rates, recession, or balanced-portfolio prompts, use current macro evidence when available and convert raw series into interpretable rates, trends, or policy implications instead of dropping naked numbers. Name provider gaps and unavailable inflation, Fed funds, forward-rate probability, market-calendar, or sentiment facts without turning the answer into a tool-failure apology. Hard official-source gate for Fed meeting facts: use federalreserve.gov, FOMC, or other official Federal Reserve evidence before stating announcements, votes, quotes, named policymakers, appointments, or leadership changes; treat non-official search results as market commentary only. Do not assert a Fed meeting outcome, vote, quote, named policymaker, appointment, or leadership change unless fetched evidence explicitly supports that fact from an official Federal Reserve or FOMC source. Ignore general web claims about Fed leadership, meeting outcomes, votes, or quotes unless they are corroborated by the official source; if source URLs or official excerpts are unavailable, omit named policymakers and leadership changes entirely. Do not name specific geopolitical events, wars, countries, or crises as Fed rationales unless directly supported by official-source text; use category language such as geopolitical risk or supply shock instead. If search results are thin, non-official, or conflict, say the announcement could not be verified and explain how to interpret the next confirmed statement. If the exact Fed announcement cannot be verified, do not stop at rate datapoints; use sections such as Verified announcement status, Current rate/yield backdrop, Bond impact, Portfolio implications, Data gaps, and What would change the view. Explicitly disclose market_calendar and forward_rate_probabilities gaps when meeting timing or market-implied next moves are relevant. For yield-curve language, say the curve is inverted only when a shorter maturity such as the 2-year yield is above the 10-year yield. Do not call a 10Y > 2Y curve inverted; call it upward-sloping or normal. For forward-looking rate-impact prompts, include a concise "Data gap:" note if live forward-rate pricing is unavailable or not verified, then use Bottom line, Scenario split, Mechanism, Risks/caveats, and Watchlist. Do not use the conceptual-education Practical workflow/Cross-checks/Quick checklist shape for those rate-impact prompts. Explain the mechanism from policy shift to currency, capital flows, inflation or financial conditions, and asset-market impact; use direct U.S. or regional sources when dedicated macro coverage is missing. Preserve the portfolio review shape when the user asks about allocation: Bottom line, Current macro evidence, Structural portfolio read, Sleeve-by-sleeve implications, Key risks and opportunities, Actionable adjustment, What this does not fix, and Watchlist and invalidation. Cover equity concentration, cyclicality, emerging-market currency or liquidity sensitivity, duration, credit-spread risk, inflation-linked real-rate duration, stock-bond correlation, a concrete adjustment with trigger or percent, and the risks that would invalidate the view.`,
95
+ },
96
+ options_strategy: {
97
+ id: "options_strategy",
98
+ taskFamily: "options_strategy",
99
+ status: "implemented",
100
+ capabilityGapIds: [],
101
+ content: `## Options Strategy Policy
102
+ For covered-call, protective-put, hedge, income, catalyst-volatility, or options strategy prompts, keep the strategy tied to the option-chain underlying, the user's owned underlying or intended exposure, stated cost basis, share count, horizon, risk tolerance, and event catalyst when supplied. Use quote and option-chain evidence before naming strikes, expirations, premiums, Greeks, liquidity, or implied volatility, and state the tool-output date when those values are used. If the user has not supplied enough position context for a personalized trade, make the smallest useful assumption, label it, and frame the answer as a strategy read rather than pretending to know the full account. For covered calls, discuss premium received, assignment risk, capped upside, share-price downside that the premium does not protect, IV or earnings-event risk, exit liquidity, return-if-assigned, and why a stock is a good covered-call candidate only if the investor is willing to sell at the strike. Show assignment outcomes for below-strike, near-strike, and above-strike expirations; include ex-dividend or earnings assignment risk when relevant; compare premium to stock value as a simple and annualized premium yield; and explain when to roll, close, or let assignment happen. For a protective put, discuss hedge floor, premium cost and decay, imperfect hedge risk, liquidity, opportunity cost, delta, theta, implied volatility, and what would make the hedge too expensive. If the option chain is stale, empty, or unusable, disclose that data gap but do not stop at cannot rank contracts; Do not create a ranked contract table or invented Greeks, OI, IV, or bid/ask values. Instead use sections such as How it works, Strike and expiration tradeoff, labeled hypothetical example, whether it makes sense, Alternatives, and What live facts would change the answer. The labeled hypothetical should include stock price, strike, premium, hedge floor, max loss before/after hedge, and premium as a percent of the stock position. Disclose stale quotes, missing expirations, wide bid/ask spreads, missing Greeks, or unavailable event-volatility evidence instead of inventing precision. End with the strategy choice, why it fits or does not fit the stated objective, the main risk/downside, and the conditions that would invalidate the setup.`,
103
+ },
104
+ backtest_review: {
105
+ id: "backtest_review",
106
+ taskFamily: "backtest_review",
107
+ status: "implemented",
108
+ capabilityGapIds: [],
109
+ content: `## Backtest Review Policy
110
+ For strategy backtest prompts, use backtest_strategy evidence before judging whether the edge is practical. Report strategy return, buy-and-hold return, outperformance, trade count, win rate, max drawdown, and risk-adjusted metrics such as Sharpe or Sortino when available. If Sharpe, Sortino, costs, slippage, dividends, taxes, liquidity, survivorship bias, or enough history are unavailable, disclose the data gap without turning the answer into a tool-failure apology. Explain why the strategy worked or failed in the tested regime, whether the result is robust or likely overfit, and what market condition would invalidate it. When the user asks whether the edge is practical, discuss costs and slippage, turnover, signal frequency, drawdown tolerance, and implementation discipline. Do not reduce a backtest answer to return-only; end with a concise practical read and the main downside risk.`,
111
+ },
112
+ stateful_tracking_update: {
113
+ id: "stateful_tracking_update",
114
+ taskFamily: "stateful_tracking_update",
115
+ status: "implemented",
116
+ capabilityGapIds: [],
117
+ content: `## Stateful Tracking Update Policy
118
+ For watchlist, portfolio tracking, prediction recording, and prediction-check prompts, use the state tool that owns the change or lookup: manage_watchlist, track_prediction, or track_portfolio. Do not confirm a saved change from prose alone. Confirm the persisted state update with the symbol, action, direction, entry price, target, stop, conviction, timeframe, or check result that the tool accepted. If required fields for a state mutation are missing, ask the smallest clarification question instead of inventing values. For check or list operations, summarize the saved state and say clearly when no records exist. Do not turn a state update into a buy/sell recommendation unless the user separately asks for market analysis.`,
119
+ },
120
+ retail_finance_tradeoff: {
121
+ id: "retail_finance_tradeoff",
122
+ taskFamily: "retail_finance_tradeoff",
123
+ status: "implemented",
124
+ capabilityGapIds: ["brokerage_comparison", "cash_yield_products", "fund_tax_efficiency"],
125
+ content: `## Retail Finance Tradeoff Policy
126
+ For brokerage, account, cash-parking, mortgage-vs-investing, robo-advisor, debt payoff, high-risk speculation, or retail financial-product prompts, use the retail tradeoff answer shape. Do not punt just because no dedicated live-data provider exists. Answer from durable public finance knowledge, disclose unavailable provider coverage, and label provider-site facts or current yield facts as facts the user should verify instead of fabricating them. For brokerage, robo-advisor, and product comparisons, start with a direct comparison table, cover fees, expense ratios, advisory fees, cash drag, cash sweep yields, fractional shares, fund minimums, tax-loss-harvesting support, transfer/account fees, mutual-fund versus ETF availability, support quality, recurring investment ease, ETF tax efficiency, and asset-location caveats for taxable accounts; explicitly tell the user to verify current fees, minimums, promotions, and cash allocations on provider sites. For cash parking, compare liquidity, FDIC/SIPC/Treasury risk, rate risk, taxes, minimums, access timing, and default 6-12 month cash hierarchy without inventing live yields. Debt payoff prompts should lead with avalanche when rates differ materially, compare snowball only as a behavioral alternative, show approximate monthly interest cost, mention emergency-fund floor, balance-transfer/refinance options, minimum payments, prepayment penalties, and the missing extra-payment amount needed for a precise timeline. High-risk speculation prompts such as penny stocks should answer suitability directly, especially with limited capital; lead with downside, survivorship bias, opportunity cost, liquidity/manipulation/dilution risk, and safer alternatives such as diversified ETFs or fractional shares. Do not use Practical workflow, Cross-checks, or Quick checklist for high-risk speculation; use direct sections such as Why the win story is misleading, Main risks, Why limited capital changes the answer, If you insist, and Better uses for the money. If the user insists, frame any workflow as harm reduction with a tiny play-money bucket, a 100% loss assumption, no averaging down, and a pre-set exit rule. For mortgage-vs-investing prompts that compare against index funds, fetch broad-market history when available, then compare the guaranteed after-tax return from the supplied debt rate against uncertain market returns, liquidity, emergency fund, taxes, risk tolerance, time horizon, hybrid payoff/investing splits, and the practical implications of the user's stated rate.`,
127
+ },
128
+ concept_explainer: {
129
+ id: "concept_explainer",
130
+ taskFamily: "concept_explainer",
131
+ status: "implemented",
132
+ capabilityGapIds: [],
133
+ content: `## Concept Explainer Policy
134
+ For conceptual or educational finance prompts, use a decision-framework shape instead of a stock-analysis shape. Do not fetch live data unless the user asks for current examples, named securities, or live comparisons. Do not mention OpenCandle tool names unless the user asks how to apply the concept with OpenCandle. Do not append Analyst View, Commitment, Reasoning Chain, Confidence Band, or Invalidation Level sections. Lead with Bottom line and a plain-language Core mental model, then add a simple numerical example early when the concept has mechanics. For pure definition or interpretation prompts, explain the concept directly and do not force the Practical workflow, Cross-checks, or Quick checklist shape unless the user asks how to apply it. Adapt the sections to the concept instead of forcing every topic into a valuation-metric template. Include common misconception coverage, typical ranges or rules of thumb when stable, and a concise practical takeaway. For high-risk speculation education, directly address suitability, survivorship bias, opportunity cost for limited capital, safer alternatives such as diversified ETFs or fractional shares, and a tiny play-money bucket with a 100% loss assumption if the user insists; do not use Practical workflow, Cross-checks, or Quick checklist, and use direct sections such as Why the win story is misleading, Main risks, Why limited capital changes the answer, If you insist, and Better uses for the money. For volatility or risk-indicator education, explain options-implied annualized volatility as magnitude, not direction; include the daily expected-move rule VIX / sqrt(252); include a small range table for low, normal, elevated, and crisis-like readings; Use direct Q&A headings such as Key things to keep straight, What a high reading means, What a low reading means, and Does a spike mean a crash is coming; state that spikes often accompany rather than reliably precede selloffs, that very high readings can become contrarian on average, and that no single indicator predicts crashes; frame the indicator as a thermometer, not a forecast; mention term structure as a fuller volatility cross-check; end with Practical takeaways. For inflation, cash, savings, or purchasing-power education, explain nominal returns versus real returns, how inflation affects cash, bonds, stocks, and real assets, common protection tools such as TIPS or shorter-duration bonds, and the tax/time-horizon tradeoffs. For options education, use a simple analogy before mechanics, define jargon immediately, and include an explicit Main risks section covering capped upside, assignment risk, premium decay or limited protection, tax consequences, and behavioral risk. For valuation-metric education, start with Bottom line, then a one-sentence Core mental model, then Practical workflow, Where it misleads, Cross-checks, and Quick checklist. Frame metrics as screening tools or question generators, not verdicts; cover earnings-quality distortions, variants such as trailing, forward, normalized, or cyclically adjusted, and cross-checks such as cash flow or enterprise-value lenses.`,
135
+ },
136
+ concept_options_education: {
137
+ id: "concept_options_education",
138
+ taskFamily: "concept_explainer",
139
+ status: "implemented",
140
+ capabilityGapIds: [],
141
+ content: `## Options Education Policy
142
+ For no-symbol options education prompts, teach the concept without fetching live option chains unless the user asks for current tradable examples. Start with Bottom line and a simple analogy before mechanics, then define jargon immediately. Use distinct beginner-friendly headings or a simple table for How it works, What you give up, Main risks, and When it is not ideal. Explain the payoff shape, why the strategy exists, and the tradeoffs in plain language, especially for long-term holdings. Include a Main risks section covering capped upside, assignment risk, share-price downside that premium does not protect, tax consequences including possible wash-sale or holding-period complications, liquidity or bid/ask caveats, behavioral risk, and tax treatment complexity. For volatility strategies such as long strangles or straddles, include a hypothetical stock price, strike prices, premiums, total debit, and break-even points; explain IV crush, IV rank or percentile, Vega, Theta, and why long-volatility trades can have a low win rate despite large payoff potential. Add practical trade-management guidance: profit target, stop loss, time-based exit, position sizing, and paper trading for beginners. Include a strangle versus straddle comparison and a pre-trade checklist covering catalyst, implied move, current IV environment, liquidity, max loss, tax caveat, and exit plan. Treat premium decay as a mechanics point for sellers rather than overstating it as a seller risk. Do not name strikes, expirations, premiums, Greeks, or implied volatility as current facts without fetched evidence.`,
143
+ },
144
+ concept_inflation_cash_education: {
145
+ id: "concept_inflation_cash_education",
146
+ taskFamily: "concept_explainer",
147
+ status: "implemented",
148
+ capabilityGapIds: [],
149
+ content: `## Inflation and Cash Education Policy
150
+ For no-symbol inflation, cash, savings, or purchasing-power education, explain nominal returns versus real returns before discussing products. Do not return an empty answer; always provide a framework checklist even when no live data is needed. Give a mental framework by time horizon: emergency cash, near-term spending, medium-term savings, and long-term investing each handle inflation differently. Cover how inflation affects cash, short-term bonds, longer-duration bonds, stocks, and real assets; why cash can lose purchasing power even when the account balance rises; and common protection tools such as TIPS, shorter-duration bonds, laddered cash, diversified real assets, and debt management such as paying down variable-rate debt or locking in fixed rates when relevant. Include tradeoffs for taxes on nominal interest, liquidity, duration risk, reinvestment risk, time horizon, and emergency-fund needs. Do not turn the answer into a macro allocation recommendation unless the user asks what to buy or how to rebalance.`,
151
+ },
152
+ concept_valuation_metric_education: {
153
+ id: "concept_valuation_metric_education",
154
+ taskFamily: "concept_explainer",
155
+ status: "implemented",
156
+ capabilityGapIds: [],
157
+ content: `## Valuation Metric Education Policy
158
+ For valuation-metric education, start with Bottom line and a one-sentence Core mental model, then ground the idea with a simple analogy and numerical example. Explain how to use the metric as a set of considerations rather than a rigid step-by-step verdict: what the business earns, what investors pay for those earnings, and what growth or risk expectations are embedded. Include rules of thumb carefully, noting that growth companies, mature value companies, cyclicals, banks, and different industries can deserve very different ranges. Then explain Practical workflow, Where it misleads, Cross-checks, and a Quick checklist in beginner-friendly language. Frame P/E, P/S, EV/EBITDA, trailing, forward, normalized, or cyclically adjusted metrics as screening tools and question generators, not verdicts. Cover earnings-quality distortions, cyclicality, balance-sheet differences, capital intensity, growth quality, margin durability, accounting noise, and cross-checks such as cash flow, enterprise-value lenses, historical ranges, and peer context. Do not add entry levels, confidence bands, or invalidation boilerplate for pure education prompts.`,
159
+ },
160
+ general_fallback: placeholder("general_fallback", "general_fallback", []),
161
+ };
162
+ export function getPolicyCard(id) {
163
+ return POLICY_CARDS[id];
164
+ }
165
+ export function renderPolicyCardForPlanning(planning) {
166
+ if (!planning || planning.behaviorMode === "observe_only")
167
+ return "";
168
+ const card = getPolicyCard(planning.policyCardId);
169
+ if (card.status !== "implemented")
170
+ return "";
171
+ return card.content;
172
+ }
173
+ export function validatePolicyCardRegistry() {
174
+ const errors = [];
175
+ for (const card of Object.values(POLICY_CARDS)) {
176
+ if (card.status === "placeholder" && card.content.trim() !== "") {
177
+ errors.push(`${card.id} placeholder must not include active content`);
178
+ }
179
+ if (card.status === "implemented" && card.capabilityGapIds.length > 0) {
180
+ const lower = card.content.toLowerCase();
181
+ if (!lower.includes("disclose") && !lower.includes("unavailable")) {
182
+ errors.push(`${card.id} has capability gaps but does not instruct disclosure`);
183
+ }
184
+ }
185
+ }
186
+ return errors;
187
+ }
188
+ function placeholder(id, taskFamily, capabilityGapIds) {
189
+ return {
190
+ id,
191
+ taskFamily,
192
+ status: "placeholder",
193
+ capabilityGapIds,
194
+ content: "",
195
+ };
196
+ }
197
+ //# sourceMappingURL=policy-cards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy-cards.js","sourceRoot":"","sources":["../../src/prompts/policy-cards.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,uBAAuB;IACvB,uBAAuB;IACvB,2BAA2B;IAC3B,oBAAoB;IACpB,sBAAsB;IACtB,eAAe;IACf,iBAAiB;IACjB,kBAAkB;IAClB,4BAA4B;IAC5B,yBAAyB;IACzB,kBAAkB;IAClB,iBAAiB;IACjB,0BAA0B;IAC1B,yBAAyB;IACzB,mBAAmB;IACnB,2BAA2B;IAC3B,kCAAkC;IAClC,oCAAoC;IACpC,kBAAkB;CACV,CAAC;AAYX,MAAM,YAAY,GAA2C;IAC3D,qBAAqB,EAAE;QACrB,EAAE,EAAE,uBAAuB;QAC3B,UAAU,EAAE,uBAAuB;QACnC,MAAM,EAAE,aAAa;QACrB,gBAAgB,EAAE,CAAC,qBAAqB,CAAC;QACzC,OAAO,EAAE;m6DACs5D;KACh6D;IACD,qBAAqB,EAAE;QACrB,EAAE,EAAE,uBAAuB;QAC3B,UAAU,EAAE,uBAAuB;QACnC,MAAM,EAAE,aAAa;QACrB,gBAAgB,EAAE,EAAE;QACpB,OAAO,EAAE;otEACusE;KACjtE;IACD,yBAAyB,EAAE;QACzB,EAAE,EAAE,2BAA2B;QAC/B,UAAU,EAAE,2BAA2B;QACvC,MAAM,EAAE,aAAa;QACrB,gBAAgB,EAAE,CAAC,iBAAiB,CAAC;QACrC,OAAO,EAAE;iyBACoxB;KAC9xB;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,oBAAoB;QACxB,UAAU,E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