@mavea/mavea 1.0.18 → 1.2.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 (211) hide show
  1. package/CHANGELOG.md +140 -1
  2. package/DISCLAIMER.md +2 -1
  3. package/PRIVACY.md +5 -4
  4. package/README.md +21 -11
  5. package/TERMS.md +3 -1
  6. package/dist/.vite/manifest.json +846 -611
  7. package/dist/assets/AnnotationLayer-qV6CIUZv.js +0 -0
  8. package/dist/assets/{AppCommandPalette-DKBglbNo.js → AppCommandPalette-BHaYBZ5e.js} +1 -1
  9. package/dist/assets/AreaChart-DZGCSEwt.js +1 -0
  10. package/dist/assets/CadenceCard-P4teI7Se.js +1 -0
  11. package/dist/assets/CanvasSkeleton-CRGWlafo.js +1 -0
  12. package/dist/assets/{CheckLogRail-Btg7Linv.js → CheckLogRail-DkHIHL0E.js} +1 -1
  13. package/dist/assets/{CommandPalette-DagPdSGZ.js → CommandPalette-Bs6tpdZl.js} +1 -1
  14. package/dist/assets/{ConversationVideoStudio-EPw6H4lE.js → ConversationVideoStudio-C1sd4k53.js} +1 -1
  15. package/dist/assets/CourseLessonReader-YCcNKEW7.js +2 -0
  16. package/dist/assets/{CourseRail-Dx9IIbTZ.js → CourseRail-DXt3bzjU.js} +1 -1
  17. package/dist/assets/{CoursesApp-CzUGaYWZ.js → CoursesApp-Dz6xjf4V.js} +2 -2
  18. package/dist/assets/{DashPresent-DXwesMIr.js → DashPresent-5SRScC2i.js} +1 -1
  19. package/dist/assets/DashboardDetail-8J8TsdQg.css +1 -0
  20. package/dist/assets/DashboardDetail-DOfm8UCQ.js +2 -0
  21. package/dist/assets/DashboardLoopGate-Cf0y_HQ7.js +2 -0
  22. package/dist/assets/DashboardLoopRuntime-CnN5VayH.js +1 -0
  23. package/dist/assets/DashboardSettings-CE0B2y2y.js +1 -0
  24. package/dist/assets/DashboardsApp-_gbfdbX6.js +2 -0
  25. package/dist/assets/{DeepZoomApp-CwqKpjo7.js → DeepZoomApp-BOLEl-kQ.js} +1 -1
  26. package/dist/assets/{DelegatePanel-Bi1qPgGG.js → DelegatePanel-CHEB-OZl.js} +1 -1
  27. package/dist/assets/DemoGallery-DBqnu8TR.js +1 -0
  28. package/dist/assets/{DropSelect-C3g0PjuN.js → DropSelect-DjbdVfIR.js} +1 -1
  29. package/dist/assets/ExportModal-CLobMv1F.js +2 -0
  30. package/dist/assets/ExtractionPreview-QZ2VHmsb.js +18 -0
  31. package/dist/assets/{FeatureUseNotice-BhljPjUv.js → FeatureUseNotice-Dc8joBGM.js} +1 -1
  32. package/dist/assets/{FlagshipCommandPalette-DyNsP8k3.js → FlagshipCommandPalette-DnWuBjYI.js} +1 -1
  33. package/dist/assets/{FlagshipShowcase-DHpGPlca.js → FlagshipShowcase-3qQDOK6g.js} +1 -1
  34. package/dist/assets/{FlashcardsApp-Cm50X3Hl.js → FlashcardsApp-BQGM-Tr1.js} +1 -1
  35. package/dist/assets/{GalleryApp-BFop9Eu7.js → GalleryApp-BWQ-J450.js} +1 -1
  36. package/dist/assets/{HonestByDesign-HeTTCiis.js → HonestByDesign-57LDf-gm.js} +1 -1
  37. package/dist/assets/{HowItWorks-gAuUl7VQ.js → HowItWorks-DMfPX3GK.js} +1 -1
  38. package/dist/assets/{LegalApp-jOlpLQSV.js → LegalApp-CcO5Qq6R.js} +1 -1
  39. package/dist/assets/{LegalMarkdownDocument-RSNiyAu0.js → LegalMarkdownDocument-Be_fQbZ_.js} +1 -1
  40. package/dist/assets/{LegalPageShell-Cr90l1I2.js → LegalPageShell-B-HY1WG7.js} +1 -1
  41. package/dist/assets/{LibraryOverlay-DEQ5GuIs.js → LibraryOverlay-BilW6q_z.js} +1 -1
  42. package/dist/assets/LiveApp-C-OPBybd.css +1 -0
  43. package/dist/assets/LiveApp-DH3OxJFV.js +79 -0
  44. package/dist/assets/{LiveSettings-jn26sH4v.js → LiveSettings-CuVMy7rZ.js} +3 -3
  45. package/dist/assets/{MindMapViewerDrawer-CDDzzpFi.js → MindMapViewerDrawer-DI_S7fRZ.js} +1 -1
  46. package/dist/assets/{MindShape-BeZFay7O.js → MindShape-C_Bo9hW9.js} +1 -1
  47. package/dist/assets/PinToDashboard-Cz5UJCmq.js +1 -0
  48. package/dist/assets/PlanReview-CmUxzNqL.js +1 -0
  49. package/dist/assets/{Presence-CKSoyuhE.js → Presence-UqXfH4Y-.js} +1 -1
  50. package/dist/assets/PresentationDeck-B_EI33Pp.js +1 -0
  51. package/dist/assets/PrismApp-DtLsPiQF.js +2 -0
  52. package/dist/assets/PrismAskController-Bt0k9hAA.js +37 -0
  53. package/dist/assets/{PrismBriefingPlayer-BoB_PCTT.js → PrismBriefingPlayer-DzdtnFj4.js} +2 -2
  54. package/dist/assets/PrismOverlay-D1cDZamt.js +105 -0
  55. package/dist/assets/{PrismWorkbench-f0rLNBxb.js → PrismWorkbench-BEIp4MiL.js} +1 -1
  56. package/dist/assets/{PrivacyApp-CFs0PM5C.js → PrivacyApp-B4DT2RUz.js} +6 -5
  57. package/dist/assets/{ReplayCard-BkJbY0-I.js → ReplayCard-Dx46HCBT.js} +2 -2
  58. package/dist/assets/{ReplayOverlay-Dm_k7FBA.js → ReplayOverlay-CnJAxf0u.js} +1 -1
  59. package/dist/assets/{RewindOverlay-BSDbLgcN.js → RewindOverlay-CousnxXo.js} +1 -1
  60. package/dist/assets/RippleApp-D5j2VCt2.js +2 -0
  61. package/dist/assets/{RippleAskController-CywVzqUA.js → RippleAskController-9SxpZnHX.js} +2 -2
  62. package/dist/assets/{RippleOverlay-DVxfWEQ8.js → RippleOverlay-zcXAHPuJ.js} +2 -2
  63. package/dist/assets/{SeeDontRead-Ct4PY63d.js → SeeDontRead-Dqfzha0V.js} +1 -1
  64. package/dist/assets/{ShareModal-BILPvqjZ.js → ShareModal-DWxlrJSz.js} +2 -2
  65. package/dist/assets/{ShipCourse-DGj9BbRM.js → ShipCourse-BavQppkt.js} +1 -1
  66. package/dist/assets/{SignatureLoop-CfM-rTXb.js → SignatureLoop-L8W2h62w.js} +1 -1
  67. package/dist/assets/SynthesisApp-C2O6pFeM.js +2 -0
  68. package/dist/assets/{SynthesisOverlay-Dunk_JWD.js → SynthesisOverlay-DLvwiSMv.js} +1 -1
  69. package/dist/assets/{TermsApp-BUQa48cB.js → TermsApp-CxY1yorm.js} +4 -2
  70. package/dist/assets/TopicCanvas-LMI0zC7R.js +2 -0
  71. package/dist/assets/{TourPrism-zt1LIaLd.js → TourPrism-CI-iJZil.js} +1 -1
  72. package/dist/assets/TrackerTile-oz6IoG8m.js +2 -0
  73. package/dist/assets/{TwoSurfaces-CLOIlVvY.js → TwoSurfaces-Rnf-_WgY.js} +1 -1
  74. package/dist/assets/WhyMachineOverlay-ks9-rRiL.js +1 -0
  75. package/dist/assets/WorldOverlay-BaQNNClA.js +2 -0
  76. package/dist/assets/WorldOverlay-D7ay5y4D.css +1 -0
  77. package/dist/assets/{WowFeatures-CNVwRlf0.js → WowFeatures-C4efSbNV.js} +1 -1
  78. package/dist/assets/{ZoomDeck-DNgyW7Nm.js → ZoomDeck-CBrr0yfy.js} +1 -1
  79. package/dist/assets/{annotationAuto-C9weSF2k.js → annotationAuto-CDv6Es44.js} +1 -1
  80. package/dist/assets/{annotationReel-va1i-lKs.js → annotationReel-K2FYv-3B.js} +1 -1
  81. package/dist/assets/{backup-D--1WRte.js → backup-ZrlVatXc.js} +1 -1
  82. package/dist/assets/{blockTypes-CgNGx27_.js → blockTypes-DUDdP3pB.js} +1 -1
  83. package/dist/assets/canvas-Bsx3eSaS.js +1 -0
  84. package/dist/assets/{capture-BBxyt5SN.js → capture-D8uPIcfj.js} +1 -1
  85. package/dist/assets/confirmAdd-DzMO9jKV.js +1 -0
  86. package/dist/assets/{coreIcons-BzqW7Qiz.js → coreIcons-DDTChE1H.js} +1 -1
  87. package/dist/assets/csv-DAqzYXUs.js +5 -0
  88. package/dist/assets/{dashboardEvents-BDKxoLch.js → dashboardEvents-DKl5rrTD.js} +1 -1
  89. package/dist/assets/dashboards-C1u2ks-d.css +1 -0
  90. package/dist/assets/dataPending-DGdCvY5Y.js +1 -0
  91. package/dist/assets/display-CAb_PiGv.js +1 -0
  92. package/dist/assets/emphasize-BqCIst-B.js +1 -0
  93. package/dist/assets/engine-BiM6INsW.js +1 -0
  94. package/dist/assets/engine-CTvOaA86.css +1 -0
  95. package/dist/assets/explode-BgZIWY9m.js +15 -0
  96. package/dist/assets/format-g3dP8OI3.js +1 -0
  97. package/dist/assets/{generate-CemSUZ8A.js → generate-Dl2EJ_SR.js} +3 -3
  98. package/dist/assets/generateBeats-DZHkvFvh.js +1 -0
  99. package/dist/assets/{generateCourse-BIBbw-ZJ.js → generateCourse-C9qvaJRo.js} +1 -1
  100. package/dist/assets/{generateLive-BsXn4Y_d.js → generateLive-B6purd69.js} +18 -18
  101. package/dist/assets/index-Dk0QapqQ.js +22 -0
  102. package/dist/assets/index-DmKgC_TJ.css +1 -0
  103. package/dist/assets/{kokoro-C6P0LV4L.js → kokoro-P_fkcX-A.js} +1 -1
  104. package/dist/assets/lens-ChFJD9il.js +1 -0
  105. package/dist/assets/{liveSchema-B8OByCPH.js → liveSchema-B4bQtO88.js} +22 -21
  106. package/dist/assets/loader-DKJEcbPm.js +2 -0
  107. package/dist/assets/{model-BsQ5ixwB.js → model-BFRTN9Eh.js} +1 -1
  108. package/dist/assets/nextFrame-12y0UrAd.js +1 -0
  109. package/dist/assets/notes-B0-EE0FK.js +1 -0
  110. package/dist/assets/number-zqlPMliA.js +1 -0
  111. package/dist/assets/officeDoc-GU6Cssjf.js +3 -0
  112. package/dist/assets/openWorld-BHTJM39n.js +1 -0
  113. package/dist/assets/{pen-D9UT-ioQ.js → pen-DNMslo3e.js} +1 -1
  114. package/dist/assets/{perfProbe-BxyiHsI2.js → perfProbe-B9zJpjo9.js} +1 -1
  115. package/dist/assets/{pin-qQrH_dBi.js → pin-CZAIlpXt.js} +1 -1
  116. package/dist/assets/{planTracker-CjnznF7v.js → planTracker-KKAtTBWs.js} +1 -1
  117. package/dist/assets/portal-Dogggsub.js +1 -0
  118. package/dist/assets/{prewarm-CAZcnT4x.js → prewarm-B4ELBOxf.js} +1 -1
  119. package/dist/assets/providers-BovElgRL.js +1 -0
  120. package/dist/assets/{quietHours-_i5Uqz7z.js → quietHours-CeBje_uU.js} +1 -1
  121. package/dist/assets/ready-Ba6nk9O1.js +1 -0
  122. package/dist/assets/{ready-4lPJes2S.js → ready-jtAUOb62.js} +1 -1
  123. package/dist/assets/receipts-D7zveV-I.js +1 -0
  124. package/dist/assets/registry-6DGRAB1m.js +1 -0
  125. package/dist/assets/{registry-BzH7mEl7.js → registry-6MOD-I7p.js} +1 -1
  126. package/dist/assets/registry-BFrgx1tE.js +1 -0
  127. package/dist/assets/{registry-COkvZrNA.css → registry-BZuT2Epw.css} +1 -1
  128. package/dist/assets/{registry-CtvKPLd7.js → registry-CD1s3eQ-.js} +1 -1
  129. package/dist/assets/{registry-NbNNn_ra.js → registry-CqhpLHM7.js} +1 -1
  130. package/dist/assets/registry-Cse2wF7x.css +1 -0
  131. package/dist/assets/registry-DGNSqTxE.js +1 -0
  132. package/dist/assets/{registry-CkScyZGa.js → registry-GeAC3ZD7.js} +1 -1
  133. package/dist/assets/{relate-DHPSGB7a.js → relate-BYdM5eiV.js} +1 -1
  134. package/dist/assets/{replay-zh4xVk5G.js → replay-TYXO0Brm.js} +1 -1
  135. package/dist/assets/{run-DiPX83_J.js → run-Df10YPyB.js} +1 -1
  136. package/dist/assets/{run-ByCJN-29.js → run-DlvA3l28.js} +1 -1
  137. package/dist/assets/{run-BdDyp6Xv.js → run-gmqUaxcL.js} +2 -2
  138. package/dist/assets/seed-D_P5jyog.js +1 -0
  139. package/dist/assets/shapes-Cx5SCKgj.js +39 -0
  140. package/dist/assets/{spokenText-D3iS8fuI.js → spokenText-C88IQJ0M.js} +1 -1
  141. package/dist/assets/store-CsjDEADX.js +1 -0
  142. package/dist/assets/theme-7IrMJ70_.js +1 -0
  143. package/dist/assets/tiles-D-s6v-mA.js +1 -0
  144. package/dist/assets/types-C42I77wh.js +1 -0
  145. package/dist/assets/types-DuEbJpIA.js +1 -0
  146. package/dist/assets/useDashboardLoop-DDqCFJKY.js +5 -0
  147. package/dist/assets/useDashboards-SRk8LqHe.js +1 -0
  148. package/dist/assets/useLiveConfig-Cpy0_E_-.js +1 -0
  149. package/dist/assets/useSpatialCanvas-CfmZOXXP.js +1 -0
  150. package/dist/assets/{useStudy-B5874Bcg.js → useStudy-GwNcQWtv.js} +1 -1
  151. package/dist/assets/validate-sGUCmPAs.js +4 -0
  152. package/dist/assets/value-Dx7DZob4.js +1 -0
  153. package/dist/assets/walkSync-CPsd-xu7.js +1 -0
  154. package/dist/index.html +14 -13
  155. package/dist/legal/DISCLAIMER.md +2 -1
  156. package/dist/legal/PRIVACY.md +5 -4
  157. package/dist/legal/TERMS.md +3 -1
  158. package/docs/media/course-lesson.jpg +0 -0
  159. package/docs/media/living-answer.jpg +0 -0
  160. package/package.json +4 -1
  161. package/dist/assets/AnnotationLayer-DHHGgh8x.js +0 -2
  162. package/dist/assets/CanvasSkeleton-Bx0s36b_.js +0 -2
  163. package/dist/assets/CourseLessonReader-DeAuL1tO.js +0 -2
  164. package/dist/assets/DashboardDetail-CJzB85NC.js +0 -2
  165. package/dist/assets/DashboardLoopRuntime-CEnUpS-I.js +0 -1
  166. package/dist/assets/DashboardSettings-CmZWG3US.js +0 -1
  167. package/dist/assets/DashboardsApp-wCgs98G0.js +0 -2
  168. package/dist/assets/DemoGallery-Cg0ykVpG.js +0 -1
  169. package/dist/assets/ExportModal-rxndDhoO.js +0 -2
  170. package/dist/assets/ExtractionPreview-ChRAimKr.js +0 -18
  171. package/dist/assets/LiveApp-Bl7WBgqJ.css +0 -1
  172. package/dist/assets/LiveApp-CUoQgVo1.js +0 -62
  173. package/dist/assets/PinToDashboard-CSqwDBLD.js +0 -1
  174. package/dist/assets/PlanReview-ChZeUHQO.js +0 -1
  175. package/dist/assets/PresentationDeck-Dj9MQVZC.js +0 -1
  176. package/dist/assets/PrismApp-Dfs6eAuR.js +0 -2
  177. package/dist/assets/PrismAskController-CSsCkRC8.js +0 -37
  178. package/dist/assets/PrismOverlay-CGtr7lBl.js +0 -109
  179. package/dist/assets/RippleApp-DW1rpKHe.js +0 -2
  180. package/dist/assets/SynthesisApp-C43ZO6Ew.js +0 -2
  181. package/dist/assets/TopicCanvas-DR26Swr_.js +0 -2
  182. package/dist/assets/TrackerTile-sYD2MM_4.js +0 -2
  183. package/dist/assets/WhyMachineOverlay-Nll4Wco-.js +0 -1
  184. package/dist/assets/canvas-DIs20T9l.js +0 -1
  185. package/dist/assets/confirmAdd-BDNV8RqF.js +0 -1
  186. package/dist/assets/dashboards-Dy4MTJQ5.css +0 -1
  187. package/dist/assets/dataPending-lZUzUEo6.js +0 -1
  188. package/dist/assets/explode-fgkkWz8o.js +0 -13
  189. package/dist/assets/format-rPI6ZwwH.js +0 -1
  190. package/dist/assets/generateBeats-aqKTlSN2.js +0 -1
  191. package/dist/assets/index-B69GkoTc.css +0 -1
  192. package/dist/assets/index-D1SPhBGd.js +0 -22
  193. package/dist/assets/notes-U6gRKVHk.js +0 -1
  194. package/dist/assets/number-DXgzss0v.js +0 -1
  195. package/dist/assets/officeDoc-Dn8jw1fG.js +0 -3
  196. package/dist/assets/portal-t0bsUEg2.js +0 -1
  197. package/dist/assets/providers-DdJWf_PE.js +0 -1
  198. package/dist/assets/ready-LSwk88I-.js +0 -1
  199. package/dist/assets/registry-9QjeHgKs.js +0 -1
  200. package/dist/assets/registry-CueC1vq1.js +0 -1
  201. package/dist/assets/registry-CxUmdwDk.js +0 -1
  202. package/dist/assets/registry-DScSjt8p.css +0 -1
  203. package/dist/assets/shapes-DI0LQC8n.js +0 -1
  204. package/dist/assets/store-DpmbKVs7.js +0 -1
  205. package/dist/assets/theme-f0mztBcq.js +0 -1
  206. package/dist/assets/tiles-pdNi6MGe.js +0 -1
  207. package/dist/assets/useDashboardLoop-DuckIfJX.js +0 -5
  208. package/dist/assets/useDashboards-BMcuCWoz.js +0 -1
  209. package/dist/assets/useLiveConfig-9eJ7EM3B.js +0 -1
  210. package/dist/assets/useSpatialCanvas-CtVsYmp8.js +0 -1
  211. /package/dist/assets/{registry-DLyrLfe-2.js → registry-DLyrLfe-.js} +0 -0
@@ -0,0 +1 @@
1
+ var e={grounded:`GROUNDED`,calculated:`CALCULATED LOCALLY`,illustrative:`ILLUSTRATIVE`,structure:`NO NUMBER`};function t(e){return e.kind===`calculated`?e.raw:e.resolution.raw}function n(e){return e.kind===`calculated`?e.value:e.resolution.ok&&e.resolution.tier!==`T0`?e.resolution.value:null}function r(e){let t=[];return e.doc!==void 0&&t.push(`doc ${e.doc+1}`),e.page!==void 0&&t.push(`p. ${e.page}`),e.cell!==void 0&&t.push(`cell ${e.cell}`),t.length?`Your file · ${t.join(`, `)}`:`Your file`}var i=/[A-Za-z_][A-Za-z0-9_]*/g;function a(e,t){return e.replace(i,e=>t(e)??e)}export{r as a,t as i,a as n,n as r,e as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./react-BZJXY1be.js";import{t}from"./jsx-runtime-DeHZSEgm.js";var n=e(),r=t(),i=`percent|points?|seconds?|minutes?|min|hours?|hrs?|days?|weeks?|months?|mo|years?|yrs?|miles?|km|kg|lbs?|watts?`,a=`(?:[kKMGT]?(?:W|Wh|B|bps|Hz|V|A)|ms|km|mi|kg|lb|oz|ft|°[CF]?)`,o=String.raw`\d(?:[\d,]*\d)?(?:\.\d+)?`,s=new RegExp(String.raw`(?<![\w.])(?:`+String.raw`[+\-−]?[$€£]\s?${o}(?:\s?[–—-]\s?${o})?(?:\s?(?:k|K|m|M|bn|B|T|million|billion|trillion)(?![A-Za-z]))?(?:\s?\/\s?[a-z]{1,5})?`+String.raw`|`+String.raw`${o}\s?[–—-]\s?${o}\s?(?:${a}|%)?`+String.raw`|`+String.raw`[+\-−]?${o}\s?(?:%|×|x(?![A-Za-z0-9]))`+String.raw`|`+String.raw`${o}${a}(?![A-Za-z0-9])`+String.raw`|`+String.raw`${o}\s(?:${i})\b`+String.raw`)`,`g`);function c(e){let t=[],n=0;s.lastIndex=0;for(let r=s.exec(e);r;r=s.exec(e))r.index>n&&t.push({text:e.slice(n,r.index),accent:!1}),t.push({text:r[0],accent:!0}),n=r.index+r[0].length;return n<e.length&&t.push({text:e.slice(n),accent:!1}),t}function l(e){return c(e).map((e,t)=>e.accent?(0,r.jsx)(`em`,{className:`hero-accent`,children:e.text},t):(0,r.jsx)(n.Fragment,{children:e.text},t))}export{l as n,c as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{t as r}from"./types-C42I77wh.js";import{r as i,t as a}from"./sourceHost-BV3t2XDb.js";import{o}from"./receipts-D7zveV-I.js";var s=e(),c=t(),l=n(),u={supported:`SUPPORTED`,contested:`CONTESTED`,provisional:`PROVISIONAL`};function d(e){let t=(0,c.c)(37),{relation:n,sign:r,status:i,receipts:a,counter:s,provisional:d}=e,m=d?`1`:void 0,h;t[0]===n?h=t[1]:(h=(0,l.jsx)(`span`,{className:`tr-rel`,children:n}),t[0]=n,t[1]=h);let g=r===1?`↑`:`↓`,_;t[2]===g?_=t[3]:(_=(0,l.jsx)(`span`,{"aria-hidden":`true`,children:g}),t[2]=g,t[3]=_);let v=r===1?`raises`:`lowers`,y;t[4]===v?y=t[5]:(y=(0,l.jsx)(`span`,{className:`tr-sr`,children:v}),t[4]=v,t[5]=y);let b;t[6]!==r||t[7]!==_||t[8]!==y?(b=(0,l.jsxs)(`span`,{className:`tr-sign`,"data-sign":r,children:[_,y]}),t[6]=r,t[7]=_,t[8]=y,t[9]=b):b=t[9];let x;t[10]===i?x=t[11]:(x=i===`supported`&&(0,l.jsx)(`span`,{"aria-hidden":`true`,children:`✓ `}),t[10]=i,t[11]=x);let S=u[i],C;t[12]!==i||t[13]!==x||t[14]!==S?(C=(0,l.jsxs)(`span`,{className:`tr-badge tr-edge-badge`,"data-status":i,children:[x,S]}),t[12]=i,t[13]=x,t[14]=S,t[15]=C):C=t[15];let w;t[16]!==C||t[17]!==h||t[18]!==b?(w=(0,l.jsxs)(`div`,{className:`tr-edge-head`,children:[h,b,C]}),t[16]=C,t[17]=h,t[18]=b,t[19]=w):w=t[19];let T;t[20]===a?T=t[21]:(T=a.map(f),t[20]=a,t[21]=T);let E;t[22]===a.length?E=t[23]:(E=a.length===0&&(0,l.jsx)(`p`,{className:`tr-unverified`,children:`Mavéa's reading — no source, unverified.`}),t[22]=a.length,t[23]=E);let D;t[24]!==s||t[25]!==i?(D=i===`contested`&&s&&(0,l.jsxs)(`div`,{className:`tr-counter`,children:[(0,l.jsx)(`h4`,{className:`tr-sec-title`,children:`But:`}),(0,l.jsx)(p,{receipt:s})]}),t[24]=s,t[25]=i,t[26]=D):D=t[26];let O=o[n],k;t[27]===O?k=t[28]:(k=(0,l.jsxs)(`p`,{className:`tr-not-as`,children:[`Not represented as: `,O,`.`]}),t[27]=O,t[28]=k);let A;return t[29]!==i||t[30]!==m||t[31]!==w||t[32]!==T||t[33]!==E||t[34]!==D||t[35]!==k?(A=(0,l.jsxs)(`div`,{className:`tr-edge`,"data-status":i,"data-provisional":m,children:[w,T,E,D,k]}),t[29]=i,t[30]=m,t[31]=w,t[32]=T,t[33]=E,t[34]=D,t[35]=k,t[36]=A):A=t[36],A}function f(e,t){return(0,l.jsx)(p,{receipt:e},`${e.url??e.quote}:${t}`)}function p(e){let t=(0,c.c)(13),{receipt:n}=e,r;t[0]===n.url?r=t[1]:(r=n.url?i(n.url):null,t[0]=n.url,t[1]=r);let o=r,s;t[2]!==n.host||t[3]!==n.url?(s=n.host??(n.url?a(n.url):null),t[2]=n.host,t[3]=n.url,t[4]=s):s=t[4];let u=s,d;t[5]===n.quote?d=t[6]:(d=(0,l.jsxs)(`blockquote`,{className:`tr-quote`,children:[`“`,n.quote,`”`]}),t[5]=n.quote,t[6]=d);let f;t[7]!==u||t[8]!==o?(f=u&&(0,l.jsx)(`figcaption`,{className:`tr-host`,children:o?(0,l.jsx)(`a`,{href:o,target:`_blank`,rel:`noreferrer noopener`,children:u}):u}),t[7]=u,t[8]=o,t[9]=f):f=t[9];let p;return t[10]!==d||t[11]!==f?(p=(0,l.jsxs)(`figure`,{className:`tr-receipt`,children:[d,f]}),t[10]=d,t[11]=f,t[12]=p):p=t[12],p}var m=(0,s.memo)(d),h=e=>e<0?0:e>1?1:e;function g(e){let t=new Set(e.nodes.map(e=>e.id)),n=new Map,r=new Map;for(let t of e.nodes)n.set(t.id,0),r.set(t.id,[]);for(let i of e.edges)!t.has(i.from)||!t.has(i.to)||i.from===i.to||(n.set(i.to,(n.get(i.to)??0)+1),r.get(i.from).push(i.to));let i=e.nodes.filter(e=>(n.get(e.id)??0)===0).map(e=>e.id),a=[];for(;i.length;){let e=i.shift();a.push(e);for(let t of r.get(e)??[])n.set(t,(n.get(t)??0)-1),n.get(t)===0&&i.push(t)}return a.length===e.nodes.length?a:null}function _(e){if(e.provenance.illustrative===!0)return!1;let t=e.nodes.find(t=>t.id===e.outcomeId);return!t||typeof t.value!=`number`||!Number.isFinite(t.value)||!r(t.tier)?!1:e.edges.length>0&&e.edges.every(e=>typeof e.weight==`number`&&Number.isFinite(e.weight)&&r(e.tier))}function v(e,t=[]){let n=g(e),r={byNode:new Map(e.nodes.map(e=>[e.id,null])),outcomeDelta:null,explainedPct:null,fullyGrounded:!1,relativeByNode:new Map(e.nodes.map(e=>[e.id,0])),relativeOutcome:null};if(!n)return r;let i=new Map;for(let e of t)e.nodeId&&i.set(e.nodeId,h(e.pct));let a=new Map;for(let t of e.edges)a.has(t.to)||a.set(t.to,[]),a.get(t.to).push(t);let o=e=>{let t=new Map;for(let r of n){let n=a.get(r)??[];if(n.length===0){t.set(r,e.get(r)??1);continue}let i=0,o=!0;for(let e of n){let n=t.get(e.from);if(n==null||typeof e.weight!=`number`){o=!1;break}i+=e.sign*e.weight*n}t.set(r,o?i:null)}return t},s=o(i),c=new Map(e.nodes.map(e=>[e.id,s.get(e.id)??null])),l=new Map;for(let e of n){let t=a.get(e)??[];if(t.length===0){l.set(e,h(i.get(e)??1));continue}let n=0;for(let e of t)n+=e.sign*(l.get(e.from)??0);l.set(e,h(n/t.length))}let u=new Map(e.nodes.map(e=>[e.id,l.get(e.id)??0])),d=l.has(e.outcomeId)?l.get(e.outcomeId):null;if(!_(e))return{byNode:c,outcomeDelta:null,explainedPct:null,fullyGrounded:!1,relativeByNode:u,relativeOutcome:d};let f=o(new Map),p=e.nodes.find(t=>t.id===e.outcomeId).value,m=s.get(e.outcomeId),v=f.get(e.outcomeId);return{byNode:c,outcomeDelta:m!=null&&v!=null?(m-v)*p:null,explainedPct:m??null,fullyGrounded:!0,relativeByNode:u,relativeOutcome:d}}export{m as n,v as t};
@@ -0,0 +1 @@
1
+ .tr-num{font:inherit;color:inherit;cursor:default;background:0 0;border:0;border-radius:2px;margin:0;padding:0;text-decoration:none}button.tr-num:hover,button.tr-num:focus-visible{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;-webkit-text-decoration-color:color-mix(in oklab, currentColor 45%, transparent);text-decoration-color:color-mix(in oklab, currentColor 45%, transparent);text-underline-offset:2px;cursor:pointer}button.tr-num:focus-visible{outline:2px solid var(--presence);outline-offset:2px}.tr-num-qual{color:var(--text-muted)}.tr-sr{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.tr-card{z-index:70;box-sizing:border-box;background:var(--surface-default);border:1px solid var(--line);border-radius:var(--r-md);box-shadow:var(--shadow-floating);flex-direction:column;gap:10px;padding:12px 14px;display:flex;position:fixed;overflow-y:auto}.tr-card:focus-visible{outline:none}.tr-head{flex-direction:column;align-items:flex-start;gap:4px;display:flex}.tr-back{font:500 11px/1.2 var(--font);color:var(--text-secondary);cursor:pointer;background:0 0;border:0;padding:0 0 2px}.tr-back:hover{color:var(--text-primary)}.tr-back-to{color:var(--text-muted)}.tr-badge{font:600 9.5px/1.4 var(--font-data,var(--font));letter-spacing:.1em;text-transform:uppercase;border-radius:var(--r-full);color:var(--text-muted);background:var(--surface-elevated);padding:2px 6px}.tr-badge[data-status=grounded]{color:var(--presence);background:color-mix(in oklab, var(--presence) 14%, transparent)}.tr-badge[data-status=calculated]{color:var(--insight);background:color-mix(in oklab, var(--insight) 14%, transparent)}.tr-badge[data-status=illustrative]{color:var(--warning);background:color-mix(in oklab, var(--warning) 12%, transparent)}.tr-figure{font:700 20px/1.15 var(--font-data,var(--font));color:var(--text-primary);margin:0}.tr-label{font:500 12px/1.35 var(--font);color:var(--text-secondary);margin:0}.tr-sec{border-top:1px solid var(--line-soft);padding-top:8px}.tr-sec-title{font:600 9.5px/1.4 var(--font-data,var(--font));letter-spacing:.12em;color:var(--text-muted);margin:0 0 6px}.tr-quote{font:400 12px/1.5 var(--font);color:var(--text-secondary);background:var(--surface-elevated);border-left:2px solid var(--presence);border-radius:0 var(--r-sm) var(--r-sm) 0;margin:0;padding:6px 9px}.tr-host{font:500 11px/1.35 var(--font-data,var(--font));color:var(--text-muted);margin:6px 0 0}.tr-host a{color:var(--presence)}.tr-date{color:var(--text-faint)}.tr-chips{flex-wrap:wrap;gap:5px;margin:0;display:flex}.tr-chip{font:500 11px/1.3 var(--font-data,var(--font));color:var(--text-secondary);background:var(--surface-elevated);border:1px solid var(--line-soft);border-radius:var(--r-full);padding:2px 7px}.tr-formula{font:500 12px/1.45 var(--font-data,var(--font));color:var(--text-primary);margin:0 0 6px}.tr-inputs,.tr-used{gap:3px;margin:0;padding:0;list-style:none;display:grid}.tr-input,.tr-usedin{text-align:left;width:100%;font:500 12px/1.4 var(--font);color:var(--text-secondary);border-radius:var(--r-sm);cursor:pointer;transition:background var(--m-fast,.12s) var(--ease-out,ease);background:0 0;border:0;align-items:baseline;gap:8px;padding:3px 5px;display:flex}.tr-input:hover,.tr-usedin:hover{background:var(--surface-elevated);color:var(--text-primary)}.tr-input-label{flex:1;min-width:0}.tr-input-val{font-family:var(--font-data,var(--font));color:var(--text-primary)}.tr-input-missing,.tr-usedin-flat{color:var(--text-faint);cursor:default}.tr-more,.tr-note{font:400 11px/1.4 var(--font);color:var(--text-muted);margin:5px 0 0}.tr-caveat{font:400 11px/1.45 var(--font);color:var(--warning);margin:0}.tr-hint{font:400 11px/1.4 var(--font);color:var(--text-faint);margin:0}.tr-edge{background:var(--surface-default);border:1px solid var(--line);border-radius:var(--r-sm);flex-direction:column;gap:8px;padding:10px 12px;display:flex}.tr-edge[data-provisional="1"]{border-style:dashed;border-color:var(--line-soft)}.tr-edge-head{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.tr-rel{font:600 12px/1.3 var(--font);color:var(--text-primary)}.tr-sign{font:600 13px/1 var(--font-data,var(--font));color:var(--text-secondary)}.tr-sign[data-sign="1"]{color:var(--presence)}.tr-sign[data-sign="-1"]{color:var(--warning)}.tr-edge-badge{margin-left:auto}.tr-edge-badge[data-status=supported]{color:var(--presence);background:color-mix(in oklab, var(--presence) 14%, transparent)}.tr-edge-badge[data-status=contested]{color:var(--warning);background:color-mix(in oklab, var(--warning) 12%, transparent)}.tr-edge-badge[data-status=provisional]{color:var(--text-muted);background:var(--surface-elevated);border:1px dashed var(--line)}.tr-receipt{margin:0}.tr-counter{border-top:1px solid var(--line-soft);padding-top:8px}.tr-counter .tr-quote{border-left-color:var(--warning)}.tr-counter .tr-sec-title{color:var(--warning)}.tr-unverified{font:400 12px/1.5 var(--font);color:var(--text-faint);margin:0;font-style:italic}.tr-not-as{font:400 11px/1.45 var(--font);color:var(--text-muted);margin:0}.tr-wi{gap:var(--s-md,14px);align-items:stretch;display:flex}.tr-wi-col{flex-direction:column;flex:1;align-items:flex-start;gap:4px;min-width:0;display:flex}.tr-wi-hypo{padding-left:var(--s-md,14px);border-left:1px dashed var(--line)}.tr-wi-chip{font:600 9.5px/1.4 var(--font-data,var(--font));letter-spacing:.1em;color:var(--text-muted);background:var(--surface-elevated);border-color:#0000}.tr-wi-chip-hypo{color:var(--insight);background:color-mix(in oklab, var(--insight) 12%, transparent);cursor:help}.tr-wi-figure{font:700 clamp(22px, 3vw, 30px) / 1.1 var(--font-data,var(--font));color:var(--text-primary);overflow-wrap:anywhere;margin:0}[data-world=hypothetical] .tr-wi-figure{color:color-mix(in oklab, var(--insight) 76%, var(--text-primary))}.tr-wi-figure.tr-wi-dash{color:var(--text-faint)}.tr-wi-figure.tr-wi-phrase{font:600 15px/1.3 var(--font)}.tr-wi-delta{font:600 13px/1.2 var(--font-data,var(--font));color:var(--text-secondary);margin:0}.tr-wi-note{font:500 11px/1.35 var(--font);color:var(--text-muted);margin:0}.tr-wi-note.tr-wi-why{color:var(--text-faint);text-wrap:pretty;font-style:italic;font-weight:400}.tr-levers{flex-direction:column;gap:8px;display:flex}.tr-levers-head{justify-content:space-between;align-items:center;gap:var(--s-sm,8px);display:flex}.tr-levers-head .tr-sec-title{margin:0}.tr-levers-empty{font:400 12.5px/1.5 var(--font);color:var(--text-muted);margin:0}.tr-levers .viz-ctl-label{-webkit-line-clamp:2;line-clamp:2;overflow-wrap:anywhere;-webkit-box-orient:vertical;min-width:0;display:-webkit-box;overflow:hidden}.tr-levers .viz-ctl-range{min-height:24px}.tr-reset{font:500 12px/1 var(--font);color:var(--text-secondary);background:var(--surface-elevated);border:1px solid var(--line);border-radius:var(--r-sm);cursor:pointer;transition:background var(--m-fast,.12s) var(--ease-out,ease);padding:5px 10px}.tr-reset:hover:not(:disabled){background:var(--surface-elevated-2,var(--surface-elevated))}.tr-reset:disabled{opacity:.45;cursor:default}@media (prefers-reduced-motion:reduce){.tr-input,.tr-usedin,.tr-reset{transition:none}}
@@ -0,0 +1,15 @@
1
+ import{t as e}from"./providers-BovElgRL.js";import{n as t}from"./speed-K5_Ebj-8.js";import{i as n,n as r,t as i}from"./cache-CvbSI-pr.js";import{t as a}from"./json-B0N3XRZU.js";import{r as o}from"./verbatim-DBTj9sPD.js";import{a as s}from"./number-zqlPMliA.js";import{a as c,i as l,n as u,r as d,s as f,t as p}from"./receipts-D7zveV-I.js";var m=new Set([`root`,`mechanism`,`outcome`]),h=[`T0`,`T1`,`T2`,`T3`],g=e=>e===`T1`||e===`T2`;function _(e,t){if(typeof e!=`string`)return null;let n=e.trim();return n?n.length>t?n.slice(0,t):n:null}var v=e=>e<0?0:e>1?1:e;function y(e){return o(e??``)}function b(e,t){let n=typeof e==`string`?a(e):e;if(!n||typeof n!=`object`||Array.isArray(n))return null;let r=n,i=_(r.center,140);if(!i)return null;let o=r.provenance&&typeof r.provenance==`object`?r.provenance:{},c=o.illustrative===!0,b=y(t),x=[];for(let e of Array.isArray(r.nodes)?r.nodes:[]){if(!e||typeof e!=`object`)continue;let t=e,n=_(t.id,40),r=_(t.label,120);if(!n||!r)continue;let i=m.has(t.role)?t.role:`mechanism`,a=typeof t.depth==`number`&&Number.isFinite(t.depth)?Math.max(0,Math.round(t.depth)):i===`root`?0:i===`outcome`?2:1,o=h.includes(t.tier)?t.tier:`T0`,u=typeof t.value==`number`&&Number.isFinite(t.value)?t.value:void 0,f=_(t.unit,12)??void 0,p=l(t),v;g(o)?p&&b(p)?(v=d(t.receipt,p),u!==void 0&&!s(u,p)&&(u=void 0)):(o=`T0`,u=void 0):o===`T3`?(!c||u===void 0)&&(o=`T0`,u=void 0):u=void 0,x.push({id:n,label:r,role:i,depth:a,tier:o,...u===void 0?{}:{value:u},...f?{unit:f}:{},...v?{receipt:v}:{}})}if(x.length<2)return null;let S=new Set(x.map(e=>e.id)),C=[];for(let e of Array.isArray(r.edges)?r.edges:[]){if(!e||typeof e!=`object`)continue;let t=e,n=_(t.from,40),r=_(t.to,40);if(!n||!r||!S.has(n)||!S.has(r)||n===r)continue;let i=t.sign===-1?-1:1,a=_(t.verb,24)??void 0,o=h.includes(t.tier)?t.tier:`T0`,s=typeof t.weight==`number`&&Number.isFinite(t.weight)?v(t.weight):void 0,c=p(t,b),m=t.relation==null?void 0:f(t.relation),y=t.counter,x=y&&typeof y==`object`?l(y):null,w=x&&b(x)?d(y,x):void 0,T=!1;g(o)&&s!==void 0&&c.length>0||(o=`T0`,s=void 0,T=!0);let E={from:n,to:r,sign:i,tier:o,...a?{verb:a}:{},...s===void 0?{}:{weight:s},...c.length?{receipt:c[0],receipts:c}:{},...w?{counter:w}:{},...m?{relation:m}:{},...T?{provisional:!0}:{}};C.push({...E,status:u(E)})}let w=_(r.outcomeId,40);(!w||!S.has(w))&&(w=(x.find(e=>e.role===`outcome`)??x.reduce((e,t)=>t.depth>e.depth?t:e)).id);let T=Array.isArray(o.notes)?o.notes.map(e=>String(e)).slice(0,6):void 0;return{center:i,outcomeId:w,nodes:x,edges:C,provenance:{...c?{illustrative:!0}:{},...T&&T.length?{notes:T}:{}}}}var x=`You are Mavéa's causal explainer. Given a "why" question and SOURCES, build a causal web: root causes → mechanisms → the outcome. Return ONLY compact JSON, no prose.
2
+
3
+ HARD HONESTY RULES:
4
+ - A node's numeric "value" or an edge's "weight" (a 0..1 share of the outcome it explains) may ONLY be given when you can quote it VERBATIM from SOURCES — put that exact sentence in "quote" and set "tier":"T2" (or "T1" if it came from the user's own attached data). weights of the edges INTO the outcome should sum to ≤ 1.
5
+ - If a cause or link comes from general knowledge with NO source sentence, set "tier":"T0" and OMIT value/weight/quote. Never invent a number, a percentage, or a citation.
6
+ - If SOURCES is empty, EVERY node and edge is "T0" with no numbers — a qualitative structure only.
7
+ - "sign" is 1 (reinforces) or -1 (dampens). "role" is "root" | "mechanism" | "outcome". "depth" grows from roots (0) to the outcome.
8
+ - "relation" says what the link CLAIMS, one of: contributes | causes | dampens | enables | correlates. Choose the WEAKEST one that is true — "causes" asserts a sole or direct cause, and most links are "contributes". Use "correlates" when the two move together and you cannot say which drives which.
9
+ - A link may carry up to 3 "receipts" (each an independently quotable sentence), and a "counter" receipt quoting a source that DISPUTES it. Both are held to the same rule as everything else: verbatim from SOURCES or omitted.
10
+ Shape: {"center":"the question","outcomeId":"<id of the outcome node>","nodes":[{"id":"","label":"","role":"","depth":0,"tier":"T0","value":0,"unit":"","quote":""}],"edges":[{"from":"","to":"","verb":"","weight":0,"sign":1,"tier":"T0","quote":"","relation":""}],"provenance":{"illustrative":false}}`,S={type:`object`,properties:{id:{type:`string`},label:{type:`string`},role:{type:`string`,enum:[`root`,`mechanism`,`outcome`]},depth:{type:`number`},tier:{type:`string`,enum:[`T0`,`T1`,`T2`,`T3`]},value:{type:`number`},unit:{type:`string`},quote:{type:`string`}},required:[`id`,`label`,`role`]},C={type:`object`,properties:{quote:{type:`string`},url:{type:`string`},host:{type:`string`},date:{type:`string`}},required:[`quote`]},w={type:`object`,properties:{from:{type:`string`},to:{type:`string`},verb:{type:`string`},weight:{type:`number`},sign:{type:`number`},tier:{type:`string`,enum:[`T0`,`T1`,`T2`,`T3`]},quote:{type:`string`},relation:{type:`string`,enum:[...c]},receipts:{type:`array`,items:C},counter:C},required:[`from`,`to`,`sign`]},T={type:`object`,properties:{center:{type:`string`},outcomeId:{type:`string`},nodes:{type:`array`,minItems:2,items:S},edges:{type:`array`,items:w},provenance:{type:`object`,properties:{illustrative:{type:`boolean`}}}},required:[`center`,`nodes`,`edges`]};function E(e){let n={slow:6,standard:9}[t(e)]??12;return{maxTokens:250+n*170,nodeCap:n}}function D(e,t,n){let r=t.trim()?t.trim().slice(0,6e3):`(none — use only general knowledge; mark EVERY node and edge "T0" with no numbers)`;return`QUESTION: ${e.trim()}
11
+
12
+ SOURCES:
13
+ ${r}
14
+
15
+ Build the causal web (${n} nodes max). Quote SOURCES verbatim for any number/weight; otherwise T0 with no numbers. Reply as compact JSON on one line.`}async function O(t,a,o,s){let c=n(`why:${t}\0${a}`,o.provider);try{let e=await i(c);if(e)return e}catch{}let{maxTokens:l,nodeCap:u}=E(o.model??o.provider),d;try{d=(await e(o.provider).generate({system:x,history:[],user:D(t,a,u),maxTokens:l,thinkingLevel:`minimal`,format:T,...s?{signal:s}:{}},o)).raw}catch{return null}if(s?.aborted)return null;let f=b(d,a);if(f)try{await r(c,f)}catch{}return f}export{O as explodeWhy};
@@ -0,0 +1 @@
1
+ import{t as e}from"./react-BZJXY1be.js";import{o as t}from"./ledger-Cv0LBflx.js";var n=e(),r=`mavea-dash-settings-v1`,i=r,a={dailySearchBudget:25,briefingEnabled:!0,briefingSpoken:!1,keyNudgeShown:!1};function o(e){return Math.min(200,Math.max(5,Math.round(e)))}function s(e){return!!e&&typeof e==`object`}function c(e){return s(e)?{dailySearchBudget:typeof e.dailySearchBudget==`number`&&Number.isFinite(e.dailySearchBudget)?o(e.dailySearchBudget):a.dailySearchBudget,briefingEnabled:typeof e.briefingEnabled==`boolean`?e.briefingEnabled:a.briefingEnabled,briefingSpoken:typeof e.briefingSpoken==`boolean`?e.briefingSpoken:a.briefingSpoken,keyNudgeShown:typeof e.keyNudgeShown==`boolean`?e.keyNudgeShown:a.keyNudgeShown}:{...a}}var l;function u(){try{if(typeof localStorage>`u`)return{...a};let e=localStorage.getItem(r);return e?c(JSON.parse(e)):{...a}}catch{return{...a}}}function d(){return l??=u(),l}function f(e){l=e;try{typeof localStorage<`u`&&localStorage.setItem(r,JSON.stringify(e))}catch{}try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(i,{detail:e}))}catch{}}function p(){return d()}function m(e){f(c({...d(),...e}))}function h(){l=void 0}function g(e){let t=t=>{(t.key===null||t.key===r)&&(h(),e())};return window.addEventListener(i,e),window.addEventListener(`storage`,t),()=>{window.removeEventListener(i,e),window.removeEventListener(`storage`,t)}}function _(){return(0,n.useSyncExternalStore)(g,p)}var v=.85;function y(e){let t=new Date(e);return t.setHours(24,0,0,0),t.getTime()}function b(e,n,r){let i=t(e,r);return{used:i,cap:n,amber:i>=n*v,paused:i>=n,resumesAt:y(r)}}function x(e,t){let n=Math.max(0,Math.round((t-e)/1e3));if(n<45)return`just now`;let r=Math.round(n/60);if(r<60)return`${r}m ago`;let i=Math.round(r/60);if(i<24)return`${i}h ago`;let a=Math.round(i/24);return a===1?`yesterday`:`${a}d ago`}function S(e,t,n){return e===null||e<=0?`not yet refreshed`:`${n===`no-change`||n===`unverified`?`checked`:`updated`} ${x(e,t)}`}function C(e){return e.metrics.filter(e=>e.query.trim()!==``&&!e.blankKey).length}function w(e){return e.widgets.filter(e=>e.refreshQuery?.trim()).length}function T(e){return C(e)>0||w(e)>0}function E(e,t){if(!T(e))return`no live metrics on this dashboard`;if(e.lastRefreshedAt===null||e.lastRefreshedAt<=0)return`not yet refreshed`;let n=x(e.lastRefreshedAt,t);return e.lastDataOutcome===`unverified`?`checked ${n} — couldn't verify with sources`:e.lastDataOutcome===`no-change`?`checked ${n} — no new data`:`updated ${n}`}function D(e){if(!Number.isFinite(e))return`—`;let t=Math.abs(e),n=t>=1e3?0:t>=100?1:t>=1?2:4;return e.toLocaleString(void 0,{maximumFractionDigits:n})}function O(e,t){return t===`$`?`$${e}`:`${e}${t??``}`}function k(e){return e.replace(/\d+\.\d{5,}/g,e=>D(Number(e)))}function A(e){return e.lastRaw?k(e.lastRaw):e.lastValue===null?`—`:O(D(e.lastValue),e.unit)}function j(e){let t=e.metrics.find(e=>e.lastValue!==null)??e.metrics[0];return t?{value:A(t),label:t.label}:null}var M=28;function N(e){let t=e.trim().replace(/\s+/g,` `),n=t;n=n.replace(/^(?:track(?:ing)?|watch(?:ing)?|follow(?:ing)?|monitor(?:ing)?)\s+(?:the\s+)?/i,``),n=n.replace(/\s+tracker\s*$/i,``);let r=n.split(/\s+[·—–-]\s+|:\s+/)[0].trim();if(r&&r.includes(` `)&&(n=r),n||=t,n.length<=M)return n;let i=n.slice(0,29),a=i.lastIndexOf(` `);return`${(a>0?i.slice(0,a):n.slice(0,M)).replace(/[\s,;:·—–-]+$/,``)}…`}function P(e){try{return new URL(e).hostname.replace(/^www\./,``)}catch{return``}}export{j as a,C as c,p as d,m as f,T as i,O as l,E as n,P as o,_ as p,N as r,w as s,S as t,b as u};
@@ -1,4 +1,4 @@
1
- import{n as e,o as t}from"./streamParse-B-Gjwa9T.js";import{t as n}from"./providers-DdJWf_PE.js";import{a as r,c as i,d as a,f as o,i as s,l as c,n as l,o as u,r as d,s as f,u as p}from"./incident-D3bmMmES.js";import{r as m}from"./githubBrowser-BDiuD9dz.js";import{r as h}from"./cache-CvbSI-pr.js";function g(n){let r={},o=t(n,`summary`);o?.trim()&&(r.summary=o.trim());let s=t(n,`gateRationale`);s?.trim()&&(r.gateRationale=s.trim());let l=i(e(n,`risks`));l?.length&&(r.risks=l);let u=f(e(n,`changes`));u?.length&&(r.changes=u);let d=a(e(n,`cascades`));d?.length&&(r.cascades=d);let p=c(e(n,`suggestions`));return p?.length&&(r.suggestions=p),r}var _=[`newgrad`,`working`,`principal`],v=e=>typeof e==`string`?e.trim():``,y=e=>typeof e==`number`&&Number.isFinite(e)&&e>0?Math.round(e):void 0,b=e=>Array.isArray(e)?e.map(v).filter(e=>e.length>0):[];function x(e){if(!e||typeof e!=`object`)return;let t=e,n={};for(let e of _){let r=v(t[e]);r&&(n[e]=r)}return Object.keys(n).length?n:void 0}function S(e){if(!e||typeof e!=`object`)return;let t=e,n=v(t.question),r=v(t.answer);return n&&r?{question:n,answer:r}:void 0}function C(e){if(!e||typeof e!=`object`)return;let t=e,n=v(t.question),r=v(t.answer);if(!n||!r)return;let i={question:n,answer:r},a=v(t.explain);a&&(i.explain=a);let o=b(t.choices),s=t.correct;return o.length>=2&&typeof s==`number`&&Number.isInteger(s)&&s>=0&&s<o.length&&(i.choices=o,i.correct=s),i}function w(e){if(!Array.isArray(e))return;let t=e.map(C).filter(e=>!!e);return t.length?t:void 0}function T(e){if(!e||typeof e!=`object`)return;let t=e,n=v(t.title),r=v(t.brief),i=b(t.steps),a=b(t.acceptance);if(!(!n||!r||i.length===0||a.length===0))return{title:n,brief:r,steps:i,acceptance:a}}var E=[`beginner`,`intermediate`,`expert`],D=e=>typeof e==`string`&&E.includes(e)?e:void 0;function O(e){if(!e||typeof e!=`object`)return;let t=e,n=v(t.title),r=Array.isArray(t.lessons)?t.lessons.map(e=>{let t=e,n=v(t.title);return n?{title:n,minutes:y(t.minutes),goal:v(t.goal),explainFor:x(t.explainFor),read:b(t.read),concepts:b(t.concepts),caution:v(t.caution)||void 0,checkpoint:S(t.checkpoint)}:null}).filter(e=>e!==null):[];if(!(!n||r.length===0))return{title:n,subtitle:v(t.subtitle)||void 0,level:D(t.level),lessons:r,quiz:w(t.quiz),capstone:T(t.capstone)}}function k(e){if(!Array.isArray(e))return;let t=[];for(let n of e){let e=O(n);e&&t.push(e)}return t.length?t:void 0}var A=`You are a staff engineer giving a new teammate the orientation you wish you had on day one of an unfamiliar codebase. Explain what the project IS and how it is laid out, give each area a concrete purpose, name how the areas depend on each other, say where to start reading, and trace how a typical request or flow moves through it — all grounded in the README, the manifest, and the real area list provided. Never invent an area, file, or dependency that is not listed. Reply with STRICT JSON only — no prose, no markdown fences.`;function j(e,t,n){let r=e.modules.slice(0,24).map(e=>`- ${e.name} (${e.health}${e.entry?`; entry ${e.entry}`:``})`).join(`
1
+ import{n as e,o as t}from"./streamParse-B-Gjwa9T.js";import{t as n}from"./providers-BovElgRL.js";import{r}from"./cache-CvbSI-pr.js";import{a as i,c as a,d as o,f as s,i as c,l,n as u,o as d,r as f,s as p,u as m}from"./incident-D3bmMmES.js";import{r as h}from"./githubBrowser-BDiuD9dz.js";function g(n){let r={},i=t(n,`summary`);i?.trim()&&(r.summary=i.trim());let s=t(n,`gateRationale`);s?.trim()&&(r.gateRationale=s.trim());let c=a(e(n,`risks`));c?.length&&(r.risks=c);let u=p(e(n,`changes`));u?.length&&(r.changes=u);let d=o(e(n,`cascades`));d?.length&&(r.cascades=d);let f=l(e(n,`suggestions`));return f?.length&&(r.suggestions=f),r}var _=[`newgrad`,`working`,`principal`],v=e=>typeof e==`string`?e.trim():``,y=e=>typeof e==`number`&&Number.isFinite(e)&&e>0?Math.round(e):void 0,b=e=>Array.isArray(e)?e.map(v).filter(e=>e.length>0):[];function x(e){if(!e||typeof e!=`object`)return;let t=e,n={};for(let e of _){let r=v(t[e]);r&&(n[e]=r)}return Object.keys(n).length?n:void 0}function S(e){if(!e||typeof e!=`object`)return;let t=e,n=v(t.question),r=v(t.answer);return n&&r?{question:n,answer:r}:void 0}function C(e){if(!e||typeof e!=`object`)return;let t=e,n=v(t.question),r=v(t.answer);if(!n||!r)return;let i={question:n,answer:r},a=v(t.explain);a&&(i.explain=a);let o=b(t.choices),s=t.correct;return o.length>=2&&typeof s==`number`&&Number.isInteger(s)&&s>=0&&s<o.length&&(i.choices=o,i.correct=s),i}function w(e){if(!Array.isArray(e))return;let t=e.map(C).filter(e=>!!e);return t.length?t:void 0}function T(e){if(!e||typeof e!=`object`)return;let t=e,n=v(t.title),r=v(t.brief),i=b(t.steps),a=b(t.acceptance);if(!(!n||!r||i.length===0||a.length===0))return{title:n,brief:r,steps:i,acceptance:a}}var E=[`beginner`,`intermediate`,`expert`],D=e=>typeof e==`string`&&E.includes(e)?e:void 0;function O(e){if(!e||typeof e!=`object`)return;let t=e,n=v(t.title),r=Array.isArray(t.lessons)?t.lessons.map(e=>{let t=e,n=v(t.title);return n?{title:n,minutes:y(t.minutes),goal:v(t.goal),explainFor:x(t.explainFor),read:b(t.read),concepts:b(t.concepts),caution:v(t.caution)||void 0,checkpoint:S(t.checkpoint)}:null}).filter(e=>e!==null):[];if(!(!n||r.length===0))return{title:n,subtitle:v(t.subtitle)||void 0,level:D(t.level),lessons:r,quiz:w(t.quiz),capstone:T(t.capstone)}}function k(e){if(!Array.isArray(e))return;let t=[];for(let n of e){let e=O(n);e&&t.push(e)}return t.length?t:void 0}var A=`You are a staff engineer giving a new teammate the orientation you wish you had on day one of an unfamiliar codebase. Explain what the project IS and how it is laid out, give each area a concrete purpose, name how the areas depend on each other, say where to start reading, and trace how a typical request or flow moves through it — all grounded in the README, the manifest, and the real area list provided. Never invent an area, file, or dependency that is not listed. Reply with STRICT JSON only — no prose, no markdown fences.`;function j(e,t,n){let r=e.modules.slice(0,24).map(e=>`- ${e.name} (${e.health}${e.entry?`; entry ${e.entry}`:``})`).join(`
2
2
  `);return[`Orient a new engineer to this codebase. Return JSON of exactly this shape:`,`{`,` "summary": "2-4 sentences: what this project is and how it is architected",`,` "modules": [ { "name": "<an area name below, verbatim>", "purpose": "one concrete line", "explain": "2-3 sentences a newcomer can act on", "depends": ["area it leans on"], "usedBy": ["area that leans on it"] } ],`,` "firstWeek": [ { "title": "a day-one task", "why": "what you learn", "file": "a real area/file to open" } ],`,` "requestLife": [ "a stop a typical request/flow passes through, in order" ]`,`}`,`Rules: use the area names verbatim in "name", "depends", and "usedBy". Ground every line in the `,`README + manifest + structure. Cover the most important 8-14 areas. 3-6 firstWeek, 3-7 requestLife. `,`Omit anything you can’t ground in the inputs.`,``,t?`README:
3
3
  `+t.slice(0,7e3):`No README was found.`,n?`
4
4
  MANIFEST (excerpt):
@@ -11,7 +11,7 @@ MANIFEST (excerpt):
11
11
  `)}var P=`You are a staff engineer writing the end-of-week CHECK for a codebase onboarding course: a short quiz plus one small capstone project, testing exactly what the week taught and grounded only in the real files and concepts given. You never invent a file, API, or behavior that isn't in the material. Reply with STRICT JSON only — no prose, no markdown fences.`;function F(e){let t=e.lessons.map(e=>`- ${e.title}${e.goal?` — ${e.goal}`:``}${e.concepts.length?` [${e.concepts.join(`, `)}]`:``}`).join(`
12
12
  `),n=Array.from(new Set(e.lessons.flatMap(e=>e.read))).slice(0,24).join(`, `);return[`Write the closing CHECK for the onboarding week "${e.title}"${e.subtitle?` (${e.subtitle})`:``}:`,`an end-of-week quiz and one small capstone project, testing what THIS week's lessons taught. Return`,`JSON of exactly this shape:`,`{ "quiz": [ { "question": "a real question testing this week's material", "choices": ["4 options, one correct"], "correct": 0, "explain": "why that's the answer, and why the others are wrong", "answer": "the correct choice's text, restated plainly" } ],`,` "capstone": { "title": "a short, concrete project name", "brief": "1-3 sentences: a small sample project grounded in THIS repo's real files and patterns (or, if a safe standalone exercise fits better, a tiny companion exercise using the same patterns)", "steps": ["a concrete step, in order"], "acceptance": ["a check a newcomer can verify themselves, without asking anyone"] } }`,``,`Give 4-6 quiz questions, each with exactly 4 "choices", a "correct" index, an "explain", and an "answer"`,`restating the right choice in plain text (so the quiz still works even if a reader never sees the`,`choices). Give exactly one "capstone". Never invent an API, file, or behavior that isn't in the`,`material below; keep the text terse.`,``,`This week's lessons:`,t,n?`\nThe real files this week studies: ${n}.`:``].join(`
13
13
  `)}var I=`You are a senior engineer giving a new teammate a deep, hands-on lesson by walking them through the REAL code in front of you. You teach thoroughly and concretely: explain the idea and how it actually works HERE, walk through the important parts of the actual code (quoting the real excerpts), name the concepts and explain them properly, call out the mistakes that bite people, and set a hands-on task. You never invent code — you quote what you are shown. Reply with STRICT JSON only.`;function L(e,t,n,r){let i=r===`newgrad`?`Your reader is a NEW GRAD — assume no prior context; explain every term, reason through every step, and err on the side of more detail.`:r===`principal`?`Your reader is a PRINCIPAL ENGINEER — skip basics, focus on the non-obvious crux, trade-offs, scale implications, and design decisions that most engineers miss.`:`Your reader is a WORKING ENGINEER — explain concepts clearly without over-explaining fundamentals; focus on how and why this specific code works the way it does.`;return[`Write a DEEP, in-depth lesson titled "${t.title}" for the course "${e.title}". ${i} Teach it`,`the way a great senior engineer walks through real code — thorough, concrete, grounded in`,`the actual files below. Return JSON of exactly this shape:`,`{`,` "overview": "SEVERAL paragraphs (use \\n\\n between them) that genuinely teach the idea and how it works HERE — not a blurb",`,` "walkthrough": [ { "file": "real/file/path", "focus": "the function / section / line range", "code": "the ACTUAL excerpt quoted from the file below", "explain": "what this part does and why it matters" } ],`,` "concepts": [ { "term": "a key idea", "explain": "a real explanation, 2-4 sentences" } ],`,` "pitfalls": ["a common mistake here and why it bites"],`,` "exercise": { "task": "a concrete hands-on task in this real code", "hint": "a nudge", "check": "a concrete, self-verifiable way to know it worked" }`,`}`,``,`This lesson studies these files/areas: ${t.read.join(`, `)||`(use the code below)`}.`,t.concepts.length?`Concepts to cover: ${t.concepts.join(`, `)}.`:``,`Rules: "walkthrough" is the SPOTLIGHT — 3-6 steps through the MOST IMPORTANT parts of the real code,`,`in reading order, each quoting the actual excerpt in "code" (verbatim from below — never invent code).`,`The "overview" must be genuinely in-depth (multiple real paragraphs that explain mechanisms, not a`,`summary). Cover 3-5 concepts and 2-4 pitfalls. "exercise.task" should aim for "day-1 first-change"`,`energy — a safe, real, tiny change to make in this actual code (not a toy sandbox); "exercise.check"`,`is HOW the learner verifies it worked without asking anyone (a command to run, an output to see, a`,`behavior to observe) — concrete and self-verifiable, not "ask a teammate to review it". Ground`,`everything in the code shown; if a file wasn’t provided, teach from what is. STRICT JSON only.`,``,`REAL CODE:`,n||`(no file contents were available — teach from the file names and your knowledge)`].join(`
14
- `)}function R(e){let t=e;if(typeof e==`string`){let n=e.replace(/```json\s*|```/gi,``),r=n.indexOf(`{`),i=n.lastIndexOf(`}`);if(r<0||i<=r)return;try{t=JSON.parse(n.slice(r,i+1))}catch{return}}if(!(!t||typeof t!=`object`))return k(t.courses)}function z(e){let t=e;if(typeof e==`string`){let n=e.replace(/```json\s*|```/gi,``),r=n.indexOf(`{`),i=n.lastIndexOf(`}`);if(r<0||i<=r)return;try{t=JSON.parse(n.slice(r,i+1))}catch{return}}if(!t||typeof t!=`object`)return;let n=t,r=w(n.quiz),i=T(n.capstone);return r||i?{quiz:r,capstone:i}:void 0}function B(e){return Array.isArray(e)?e.map(e=>{let t=e,n=v(t.explain),r=v(t.file);if(!n&&!r)return null;let i={file:r,explain:n};return v(t.focus)&&(i.focus=v(t.focus)),v(t.code)&&(i.code=typeof t.code==`string`?t.code:v(t.code)),i}).filter(e=>e!==null):[]}function V(e){return Array.isArray(e)?e.map(e=>{let t=e;return{term:v(t.term),explain:v(t.explain)}}).filter(e=>e.term.length>0&&e.explain.length>0):[]}function H(e){let t=e;if(typeof e==`string`){let n=e.replace(/```json\s*|```/gi,``),r=n.indexOf(`{`),i=n.lastIndexOf(`}`);if(r<0||i<=r)return null;try{t=JSON.parse(n.slice(r,i+1))}catch{return null}}if(!t||typeof t!=`object`)return null;let n=t,r=v(n.overview),i=B(n.walkthrough),a=V(n.concepts),o=b(n.pitfalls),s=n.exercise,c=s&&v(s.task)?{task:v(s.task),...v(s.hint)?{hint:v(s.hint)}:{},...v(s.check)?{check:v(s.check)}:{}}:void 0;if(!r&&i.length===0&&a.length===0)return null;let l={overview:r,walkthrough:i,concepts:a};return o.length&&(l.pitfalls=o),c&&(l.exercise=c),l}function U(e){let t=e;if(typeof e==`string`){let n=e.replace(/```json\s*|```/gi,``),r=n.indexOf(`{`),i=n.lastIndexOf(`}`);if(r<0||i<=r)return null;try{t=JSON.parse(n.slice(r,i+1))}catch{return null}}if(!t||typeof t!=`object`)return null;let n=t,r=v(n.summary)||void 0,i=Array.isArray(n.modules)?n.modules.map(e=>{let t=e,n=v(t.name);return n?{name:n,purpose:v(t.purpose)||void 0,explain:v(t.explain)||void 0,depends:b(t.depends),usedBy:b(t.usedBy)}:null}).filter(e=>e!==null):void 0,a=[];if(Array.isArray(n.firstWeek))for(let e of n.firstWeek){let t=e,n=v(t.title);n&&a.push({title:n,why:v(t.why)||void 0,file:v(t.file)||void 0})}let o=Array.isArray(n.requestLife)?b(n.requestLife):void 0,s=k(n.courses)??(O(n.course)?[O(n.course)]:void 0);return!r&&!i?.length&&!a.length&&!o?.length&&!s?.length?null:{summary:r,modules:i,firstWeek:a.length?a:void 0,requestLife:o,courses:s}}function W(e,t){let n=new Map((t.modules??[]).map(e=>[e.name,e]));return{...e,pr:{...e.pr,summary:t.summary||e.pr.summary},modules:e.modules.map(e=>{let t=n.get(e.name);return t?{...e,purpose:t.purpose||e.purpose,explain:t.explain||e.explain,depends:t.depends&&t.depends.length?t.depends:e.depends,usedBy:t.usedBy&&t.usedBy.length?t.usedBy:e.usedBy}:e}),onboarding:{firstWeek:t.firstWeek&&t.firstWeek.length?t.firstWeek.map(e=>({team:`Week 1`,title:e.title,sub:e.why??``,file:e.file??``})):e.onboarding?.firstWeek??[],requestLife:t.requestLife&&t.requestLife.length?t.requestLife:e.onboarding?.requestLife??[]},courses:t.courses??e.courses}}async function G(e,t,i,a={}){let{signal:s,codeContext:c,onPartial:l,maxTokens:d=2600,thinkingLevel:f}=a;try{let a=``,m=l?(e,t)=>{if(t?.reasoning)return;a+=e;let n=g(a);(n.summary||n.gateRationale||n.risks||n.changes||n.cascades||n.suggestions)&&l(n)}:void 0,h=await n(i.provider).generate({system:r,systemBase:r,history:[],user:u(e,t,c),maxTokens:d,temperature:0,format:null,...f?{thinkingLevel:f}:{},...s?{signal:s}:{}},i,m);if(s?.aborted)return e;let _=o(h.raw);return _?p(e,_,i.model):null}catch(t){return t instanceof DOMException&&t.name===`AbortError`?e:null}}async function K(e,t){let[n,r]=await Promise.all([Promise.all([`README.md`,`readme.md`,`Readme.md`,`docs/README.md`].map(n=>m(n,t,e).catch(()=>({ok:!1})))).then(e=>{let t=e.find(e=>e.ok&&e.content);return t&&t.ok?t.content??``:``}),m(`package.json`,t,e).catch(()=>({ok:!1})).then(e=>e.ok&&e.content?e.content:``)]);return{readme:n,pkg:r}}async function q(e,t,r,i,a={}){let{signal:o,maxTokens:s=2600,thinkingLevel:c}=a;if(e.modules.length===0)return e;try{let{readme:a,pkg:l}=await K(t,r);if(o?.aborted)return e;let u=await n(i.provider).generate({system:A,systemBase:A,history:[],user:j(e,a,l),maxTokens:s,temperature:0,format:null,...c?{thinkingLevel:c}:{},...o?{signal:o}:{}},i).then(e=>U(e.raw)).catch(()=>null);return o?.aborted||!u?e:W(e,u)}catch{return e}}async function J(e,t,r,i,a={}){let{signal:o,count:s=5,maxTokens:c=4e3,thinkingLevel:l,focus:u}=a;if(e.modules.length!==0)try{let{readme:a,pkg:d}=await K(t,r);if(o?.aborted)return;let f=await n(i.provider).generate({system:M,systemBase:M,history:[],user:N(e,a,d,s,u),maxTokens:c,temperature:0,format:null,...l?{thinkingLevel:l}:{},...o?{signal:o}:{}},i).then(e=>R(e.raw)).catch(()=>void 0);return o?.aborted?void 0:f&&f.length?f:void 0}catch{return}}async function Y(e,t,r={}){let{signal:i,maxTokens:a=4e3,thinkingLevel:o}=r;if(e.lessons.length)try{let r=await n(t.provider).generate({system:P,systemBase:P,history:[],user:F(e),maxTokens:a,temperature:0,format:null,...o?{thinkingLevel:o}:{},...i?{signal:i}:{}},t);return i?.aborted?void 0:z(r.raw)}catch{return}}var X=3,Z=140;async function Q(e,t,n){let r=e.read.filter(e=>/\.[a-z0-9]+$/i.test(e)).slice(0,X),i=(await Promise.all(r.map(e=>m(e,t,n).catch(()=>({ok:!1})).then(t=>({file:e,r:t}))))).filter(e=>e.r.ok&&e.r.content).map(e=>{let t=e.r.content.split(`
14
+ `)}function R(e){let t=e;if(typeof e==`string`){let n=e.replace(/```json\s*|```/gi,``),r=n.indexOf(`{`),i=n.lastIndexOf(`}`);if(r<0||i<=r)return;try{t=JSON.parse(n.slice(r,i+1))}catch{return}}if(!(!t||typeof t!=`object`))return k(t.courses)}function z(e){let t=e;if(typeof e==`string`){let n=e.replace(/```json\s*|```/gi,``),r=n.indexOf(`{`),i=n.lastIndexOf(`}`);if(r<0||i<=r)return;try{t=JSON.parse(n.slice(r,i+1))}catch{return}}if(!t||typeof t!=`object`)return;let n=t,r=w(n.quiz),i=T(n.capstone);return r||i?{quiz:r,capstone:i}:void 0}function B(e){return Array.isArray(e)?e.map(e=>{let t=e,n=v(t.explain),r=v(t.file);if(!n&&!r)return null;let i={file:r,explain:n};return v(t.focus)&&(i.focus=v(t.focus)),v(t.code)&&(i.code=typeof t.code==`string`?t.code:v(t.code)),i}).filter(e=>e!==null):[]}function V(e){return Array.isArray(e)?e.map(e=>{let t=e;return{term:v(t.term),explain:v(t.explain)}}).filter(e=>e.term.length>0&&e.explain.length>0):[]}function H(e){let t=e;if(typeof e==`string`){let n=e.replace(/```json\s*|```/gi,``),r=n.indexOf(`{`),i=n.lastIndexOf(`}`);if(r<0||i<=r)return null;try{t=JSON.parse(n.slice(r,i+1))}catch{return null}}if(!t||typeof t!=`object`)return null;let n=t,r=v(n.overview),i=B(n.walkthrough),a=V(n.concepts),o=b(n.pitfalls),s=n.exercise,c=s&&v(s.task)?{task:v(s.task),...v(s.hint)?{hint:v(s.hint)}:{},...v(s.check)?{check:v(s.check)}:{}}:void 0;if(!r&&i.length===0&&a.length===0)return null;let l={overview:r,walkthrough:i,concepts:a};return o.length&&(l.pitfalls=o),c&&(l.exercise=c),l}function U(e){let t=e;if(typeof e==`string`){let n=e.replace(/```json\s*|```/gi,``),r=n.indexOf(`{`),i=n.lastIndexOf(`}`);if(r<0||i<=r)return null;try{t=JSON.parse(n.slice(r,i+1))}catch{return null}}if(!t||typeof t!=`object`)return null;let n=t,r=v(n.summary)||void 0,i=Array.isArray(n.modules)?n.modules.map(e=>{let t=e,n=v(t.name);return n?{name:n,purpose:v(t.purpose)||void 0,explain:v(t.explain)||void 0,depends:b(t.depends),usedBy:b(t.usedBy)}:null}).filter(e=>e!==null):void 0,a=[];if(Array.isArray(n.firstWeek))for(let e of n.firstWeek){let t=e,n=v(t.title);n&&a.push({title:n,why:v(t.why)||void 0,file:v(t.file)||void 0})}let o=Array.isArray(n.requestLife)?b(n.requestLife):void 0,s=k(n.courses)??(O(n.course)?[O(n.course)]:void 0);return!r&&!i?.length&&!a.length&&!o?.length&&!s?.length?null:{summary:r,modules:i,firstWeek:a.length?a:void 0,requestLife:o,courses:s}}function W(e,t){let n=new Map((t.modules??[]).map(e=>[e.name,e]));return{...e,pr:{...e.pr,summary:t.summary||e.pr.summary},modules:e.modules.map(e=>{let t=n.get(e.name);return t?{...e,purpose:t.purpose||e.purpose,explain:t.explain||e.explain,depends:t.depends&&t.depends.length?t.depends:e.depends,usedBy:t.usedBy&&t.usedBy.length?t.usedBy:e.usedBy}:e}),onboarding:{firstWeek:t.firstWeek&&t.firstWeek.length?t.firstWeek.map(e=>({team:`Week 1`,title:e.title,sub:e.why??``,file:e.file??``})):e.onboarding?.firstWeek??[],requestLife:t.requestLife&&t.requestLife.length?t.requestLife:e.onboarding?.requestLife??[]},courses:t.courses??e.courses}}async function G(e,t,r,a={}){let{signal:o,codeContext:c,onPartial:l,maxTokens:u=2600,thinkingLevel:f}=a;try{let a=``,p=l?(e,t)=>{if(t?.reasoning)return;a+=e;let n=g(a);(n.summary||n.gateRationale||n.risks||n.changes||n.cascades||n.suggestions)&&l(n)}:void 0,h=await n(r.provider).generate({system:i,systemBase:i,history:[],user:d(e,t,c),maxTokens:u,temperature:0,format:null,...f?{thinkingLevel:f}:{},...o?{signal:o}:{}},r,p);if(o?.aborted)return e;let _=s(h.raw);return _?m(e,_,r.model):null}catch(t){return t instanceof DOMException&&t.name===`AbortError`?e:null}}async function K(e,t){let[n,r]=await Promise.all([Promise.all([`README.md`,`readme.md`,`Readme.md`,`docs/README.md`].map(n=>h(n,t,e).catch(()=>({ok:!1})))).then(e=>{let t=e.find(e=>e.ok&&e.content);return t&&t.ok?t.content??``:``}),h(`package.json`,t,e).catch(()=>({ok:!1})).then(e=>e.ok&&e.content?e.content:``)]);return{readme:n,pkg:r}}async function q(e,t,r,i,a={}){let{signal:o,maxTokens:s=2600,thinkingLevel:c}=a;if(e.modules.length===0)return e;try{let{readme:a,pkg:l}=await K(t,r);if(o?.aborted)return e;let u=await n(i.provider).generate({system:A,systemBase:A,history:[],user:j(e,a,l),maxTokens:s,temperature:0,format:null,...c?{thinkingLevel:c}:{},...o?{signal:o}:{}},i).then(e=>U(e.raw)).catch(()=>null);return o?.aborted||!u?e:W(e,u)}catch{return e}}async function J(e,t,r,i,a={}){let{signal:o,count:s=5,maxTokens:c=4e3,thinkingLevel:l,focus:u}=a;if(e.modules.length!==0)try{let{readme:a,pkg:d}=await K(t,r);if(o?.aborted)return;let f=await n(i.provider).generate({system:M,systemBase:M,history:[],user:N(e,a,d,s,u),maxTokens:c,temperature:0,format:null,...l?{thinkingLevel:l}:{},...o?{signal:o}:{}},i).then(e=>R(e.raw)).catch(()=>void 0);return o?.aborted?void 0:f&&f.length?f:void 0}catch{return}}async function Y(e,t,r={}){let{signal:i,maxTokens:a=4e3,thinkingLevel:o}=r;if(e.lessons.length)try{let r=await n(t.provider).generate({system:P,systemBase:P,history:[],user:F(e),maxTokens:a,temperature:0,format:null,...o?{thinkingLevel:o}:{},...i?{signal:i}:{}},t);return i?.aborted?void 0:z(r.raw)}catch{return}}var X=3,Z=140;async function Q(e,t,n){let i=e.read.filter(e=>/\.[a-z0-9]+$/i.test(e)).slice(0,X),a=(await Promise.all(i.map(e=>h(e,t,n).catch(()=>({ok:!1})).then(t=>({file:e,r:t}))))).filter(e=>e.r.ok&&e.r.content).map(e=>{let t=e.r.content.split(`
15
15
  `).slice(0,Z).join(`
16
16
  `);return`FILE ${e.file}:\n${t}\n`}).join(`
17
- `);return{codeContext:i,contentHash:h(i)}}async function $(e,t,r,i,a={}){let{signal:o,maxTokens:s=4200,thinkingLevel:c,altitude:l}=a;try{let a=await n(i.provider).generate({system:I,systemBase:I,history:[],user:L(e,t,r,l),maxTokens:s,temperature:0,format:null,...c?{thinkingLevel:c}:{},...o?{signal:o}:{}},i);return o?.aborted?null:H(a.raw)}catch{return null}}async function ee(e,t,r,i){if(!e.incident)return e;try{let a=await n(r.provider).generate({system:`You are an on-call engineer reasoning BACKWARDS from a production alert to its likely cause. You ground every claim in the alert and the change provided; you never invent deploys, services, or people. The rollback is a draft the human runs — never an action you take. Reply with STRICT JSON only.`,history:[],user:l(t,e),maxTokens:1500,temperature:0,format:null,...i?{signal:i}:{}},r);if(i?.aborted)return e;let o=s(a.raw);return o?{...e,incident:d(e.incident,o)}:e}catch{return e}}export{Y as enrichCourseClosing,J as enrichCourses,ee as enrichIncident,$ as enrichLesson,q as enrichOrientation,G as enrichShipModel,Q as gatherLessonCode};
17
+ `);return{codeContext:a,contentHash:r(a)}}async function $(e,t,r,i,a={}){let{signal:o,maxTokens:s=4200,thinkingLevel:c,altitude:l}=a;try{let a=await n(i.provider).generate({system:I,systemBase:I,history:[],user:L(e,t,r,l),maxTokens:s,temperature:0,format:null,...c?{thinkingLevel:c}:{},...o?{signal:o}:{}},i);return o?.aborted?null:H(a.raw)}catch{return null}}async function ee(e,t,r,i){if(!e.incident)return e;try{let a=await n(r.provider).generate({system:`You are an on-call engineer reasoning BACKWARDS from a production alert to its likely cause. You ground every claim in the alert and the change provided; you never invent deploys, services, or people. The rollback is a draft the human runs — never an action you take. Reply with STRICT JSON only.`,history:[],user:u(t,e),maxTokens:1500,temperature:0,format:null,...i?{signal:i}:{}},r);if(i?.aborted)return e;let o=c(a.raw);return o?{...e,incident:f(e.incident,o)}:e}catch{return e}}export{Y as enrichCourseClosing,J as enrichCourses,ee as enrichIncident,$ as enrichLesson,q as enrichOrientation,G as enrichShipModel,Q as gatherLessonCode};
@@ -0,0 +1 @@
1
+ import{c as e}from"./walkSync-CPsd-xu7.js";var t=1700;function n(e){let t=e.props;if(!t||typeof t!=`object`)return``;let n=t;for(let e of[`title`,`eyebrow`,`headline`,`head`,`label`,`name`,`query`]){let t=n[e];if(typeof t==`string`&&t.trim())return t.trim()}return``}function r(e,t){let r=new Set(e.map(e=>e.id).filter(e=>!!e));if(t&&t.length){let e=new Set,n=[];for(let i of t)if(!(!i||!r.has(i.spot)||e.has(i.spot))&&(e.add(i.spot),n.push({spot:i.spot,say:i.say}),n.length>=r.size))break;if(n.length)return n}return e.filter(e=>!!e.id).map(e=>({spot:e.id,say:n(e)}))}function i(n,i={}){let a=r(n,i.tour);if(!a.length)return[];let o=i.startId?Math.max(0,a.findIndex(e=>e.spot===i.startId)):0,s=a.slice(o),c=i.maxStops?s.slice(0,Math.max(1,i.maxStops)):s,l=i.dwellMs??t,u=c.map((t,n)=>{let r=n===0?i.opener??t.say??``:t.say??``,a={spot:t.spot,pstate:`showing`,gaze:`right`};return r&&(a.caption=r),{set:a,ms:e(r,l)}});return u.push({set:{spot:null,pstate:`idle`,status:null}}),u}function a(e){return e.hasModelTour?!0:e.blockCount>=5||e.mode!==`replace`||e.teach}export{a as n,i as t};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-DkW27tQK.js";import{t}from"./providers-DdJWf_PE.js";var n=e({generateCheckpoint:()=>x,generateCourse:()=>b}),r=3,i=9,a=9e4;function o(e,t){let n=e instanceof Error?e.message:String(e);return/\b429\b|rate.?limit|quota|resource.?exhausted/i.test(n)?`${t} is rate-limiting right now — wait a moment and try again.`:/\b40[13]\b|api key|unauthor|permission/i.test(n)?`${t} rejected the request — check its API key in settings.`:/\b5\d\d\b|overloaded|unavailable/i.test(n)?`${t} had a server error — try again in a moment.`:`Couldn't reach ${t} to build the course — check your connection and its key, then try again.`}var s=2;function c(e){return e.replace(/^```[a-z]*\n?/,``).replace(/\n?```$/,``).trim()}function l(e){return typeof e==`string`&&e.trim().length>0}function u(e,t){return Array.isArray(e)?e.filter(l).map(e=>e.trim()).slice(0,t):[]}function d(e){return Array.isArray(e)?e.map(e=>{if(!e||typeof e!=`object`)return null;let t=e;return!l(t.question)||!l(t.answer)?null:{question:t.question.trim(),answer:t.answer.trim()}}).filter(e=>e!==null):[]}function f(e,t){if(!e||typeof e!=`object`)return null;let n=e;if(!l(n.title)||!l(n.goal))return null;let r=u(n.objectives,4);return r.length<2?null:{id:`l${t+1}`,title:n.title.trim(),goal:n.goal.trim(),objectives:r,concepts:u(n.concepts,8),...typeof n.minutes==`number`&&Number.isFinite(n.minutes)&&n.minutes>0?{minutes:Math.round(n.minutes)}:{}}}var p=new Set([`beginner`,`intermediate`,`expert`]);function m(e){return typeof e==`string`&&p.has(e)?e:void 0}function h(){try{let e=globalThis.crypto;if(e?.randomUUID)return e.randomUUID()}catch{}return`course-${Date.now().toString(36)}-${Math.floor(Math.random()*1e9).toString(36)}`}var g=`You are building a self-paced course syllabus — a real curriculum a motivated learner could follow lesson by lesson, each a single sitting that concretely builds on the one before.
1
+ import{r as e}from"./rolldown-runtime-DkW27tQK.js";import{t}from"./providers-BovElgRL.js";var n=e({generateCheckpoint:()=>x,generateCourse:()=>b}),r=3,i=9,a=9e4;function o(e,t){let n=e instanceof Error?e.message:String(e);return/\b429\b|rate.?limit|quota|resource.?exhausted/i.test(n)?`${t} is rate-limiting right now — wait a moment and try again.`:/\b40[13]\b|api key|unauthor|permission/i.test(n)?`${t} rejected the request — check its API key in settings.`:/\b5\d\d\b|overloaded|unavailable/i.test(n)?`${t} had a server error — try again in a moment.`:`Couldn't reach ${t} to build the course — check your connection and its key, then try again.`}var s=2;function c(e){return e.replace(/^```[a-z]*\n?/,``).replace(/\n?```$/,``).trim()}function l(e){return typeof e==`string`&&e.trim().length>0}function u(e,t){return Array.isArray(e)?e.filter(l).map(e=>e.trim()).slice(0,t):[]}function d(e){return Array.isArray(e)?e.map(e=>{if(!e||typeof e!=`object`)return null;let t=e;return!l(t.question)||!l(t.answer)?null:{question:t.question.trim(),answer:t.answer.trim()}}).filter(e=>e!==null):[]}function f(e,t){if(!e||typeof e!=`object`)return null;let n=e;if(!l(n.title)||!l(n.goal))return null;let r=u(n.objectives,4);return r.length<2?null:{id:`l${t+1}`,title:n.title.trim(),goal:n.goal.trim(),objectives:r,concepts:u(n.concepts,8),...typeof n.minutes==`number`&&Number.isFinite(n.minutes)&&n.minutes>0?{minutes:Math.round(n.minutes)}:{}}}var p=new Set([`beginner`,`intermediate`,`expert`]);function m(e){return typeof e==`string`&&p.has(e)?e:void 0}function h(){try{let e=globalThis.crypto;if(e?.randomUUID)return e.randomUUID()}catch{}return`course-${Date.now().toString(36)}-${Math.floor(Math.random()*1e9).toString(36)}`}var g=`You are building a self-paced course syllabus — a real curriculum a motivated learner could follow lesson by lesson, each a single sitting that concretely builds on the one before.
2
2
 
3
3
  Rules:
4
4
  - 5-7 lessons. Each lesson is ONE sitting (15-30 min) with a narrow, specific scope — never a vague "overview" lesson.