@malloy-publisher/server 0.0.137 → 0.0.139

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 (294) hide show
  1. package/dist/app/api-doc.yaml +92 -11
  2. package/dist/app/assets/HomePage-CQQtnhcv.js +1 -0
  3. package/dist/app/assets/{MainPage-gzYdjQav.js → MainPage-Me4a98WA.js} +1 -1
  4. package/dist/app/assets/{ModelPage-CUAaN3rL.js → ModelPage-B_VzcPz-.js} +1 -1
  5. package/dist/app/assets/{PackagePage-DcWkgxZq.js → PackagePage-BWJwQ0O9.js} +1 -1
  6. package/dist/app/assets/{ProjectPage-Bpgs1NvH.js → ProjectPage-CeX3CJ-3.js} +1 -1
  7. package/dist/app/assets/RouteError-Cewq7gMv.js +1 -0
  8. package/dist/app/assets/{WorkbookPage-B2aMRJtD.js → WorkbookPage-DXH5UPpT.js} +1 -1
  9. package/dist/app/assets/index-C3oq1gR3.js +465 -0
  10. package/dist/app/assets/{index-D0zwjcl_.js → index-DHv0ZYf4.js} +1 -1
  11. package/dist/app/assets/{index-CKzqCaQl.js → index-Dj2cZUxB.js} +1 -1
  12. package/dist/app/assets/{index.umd-bQQqKuZo.js → index.umd-BgVp8VMZ.js} +1 -1
  13. package/dist/app/index.html +1 -1
  14. package/dist/server.js +134 -25
  15. package/package.json +1 -1
  16. package/src/controller/model.controller.ts +27 -2
  17. package/src/mcp/resources/notebook_resource.ts +3 -3
  18. package/src/server.ts +48 -7
  19. package/src/service/model.ts +154 -41
  20. package/dist/app/assets/HomePage-Dy1B_c_L.js +0 -1
  21. package/dist/app/assets/RouteError-Cd7ol6pR.js +0 -1
  22. package/dist/app/assets/abap-BmBUA35e.es-DsBKuouk.js +0 -1
  23. package/dist/app/assets/actionscript-3-zFUbzQa9.es-D_z4Izcz.js +0 -1
  24. package/dist/app/assets/ada-CBvPkFpZ.es-727ZlQH0.js +0 -1
  25. package/dist/app/assets/andromeeda-uXNdzNpk.es-C3khCPGq.js +0 -1
  26. package/dist/app/assets/angular-html-D3aW1y6T.es-CRu3QO-y.js +0 -1
  27. package/dist/app/assets/angular-ts-Jud40GrY.es-ZQeME4ih.js +0 -1
  28. package/dist/app/assets/apache-CVNlsSDc.es-Dn00JSTd.js +0 -1
  29. package/dist/app/assets/apex-DFk3KRB1.es-COJ4H7py.js +0 -1
  30. package/dist/app/assets/apl-pE3PRTDr.es-CQSepgku.js +0 -1
  31. package/dist/app/assets/applescript-CYMR_y0g.es-Bu5BbsvL.js +0 -1
  32. package/dist/app/assets/ara-4QmU5e04.es-7O62HKoU.js +0 -1
  33. package/dist/app/assets/asciidoc-v_1bjgUg.es-BPT9niGB.js +0 -1
  34. package/dist/app/assets/asm-RC0Yh-NZ.es-Dhn9LcZ4.js +0 -1
  35. package/dist/app/assets/astro-Be6fybGX.es-fPsVT2Pm.js +0 -1
  36. package/dist/app/assets/aurora-x-BwoVEUWZ.es-D-2ljcwZ.js +0 -1
  37. package/dist/app/assets/awk-gPH8MVMW.es-eg146-Ew.js +0 -1
  38. package/dist/app/assets/ayu-dark-CxPZkpb2.es-Cv9koXgw.js +0 -1
  39. package/dist/app/assets/ballerina-kvLnRU_e.es-Du268qiB.js +0 -1
  40. package/dist/app/assets/bat-BHYy44sT.es-fje9CFhw.js +0 -1
  41. package/dist/app/assets/beancount-D-MADTs_.es-BwXTMy5W.js +0 -1
  42. package/dist/app/assets/berry-Ci9U0o4h.es-3xVqZejG.js +0 -1
  43. package/dist/app/assets/bibtex-CX618D15.es-xW4inM5L.js +0 -1
  44. package/dist/app/assets/bicep-iuYiPopT.es-DHo0CJ0O.js +0 -1
  45. package/dist/app/assets/blade-DmXp5Zcz.es-D3zQbxlG.js +0 -1
  46. package/dist/app/assets/bsl-NPX_d-bb.es-CKrxbqO6.js +0 -1
  47. package/dist/app/assets/c-DASdrs7p.es-C3t2pwGQ.js +0 -1
  48. package/dist/app/assets/cadence-BDALQi26.es-DNquZEk8.js +0 -1
  49. package/dist/app/assets/cairo-17kO8-kb.es-N2Uzg40c.js +0 -1
  50. package/dist/app/assets/catppuccin-frappe-BrTOiad2.es-CD_QflpE.js +0 -1
  51. package/dist/app/assets/catppuccin-latte-D-dc_R4m.es-DRW-0cLl.js +0 -1
  52. package/dist/app/assets/catppuccin-macchiato-DN4jOp0G.es-C-_shW-Y.js +0 -1
  53. package/dist/app/assets/catppuccin-mocha-B8yCE3-3.es-LGGdnPYs.js +0 -1
  54. package/dist/app/assets/clarity-CNgV2Ths.es-BHOwM8T6.js +0 -1
  55. package/dist/app/assets/clojure-CsKKFGwv.es-DxSadP1t.js +0 -1
  56. package/dist/app/assets/cmake-Dr-A3iJx.es-DbXoA79R.js +0 -1
  57. package/dist/app/assets/cobol-BzcJm6ie.es-BWBq31KV.js +0 -1
  58. package/dist/app/assets/codeowners-Bt9yU6NX.es-Bp6g37R7.js +0 -1
  59. package/dist/app/assets/codeql-DBNTqJi1.es-sacFqUAJ.js +0 -1
  60. package/dist/app/assets/coffee-q2iaxUnQ.es-B85jwlP6.js +0 -1
  61. package/dist/app/assets/common-lisp-r7ZEOG7T.es-C7gG9l05.js +0 -1
  62. package/dist/app/assets/coq-CB6Pv_W9.es-Dsg_Bt_b.js +0 -1
  63. package/dist/app/assets/cpp-CPQtoCcU.es-D1V2BO11.js +0 -1
  64. package/dist/app/assets/crystal-BY_Cg265.es-H3j-N6XT.js +0 -1
  65. package/dist/app/assets/csharp-CYWRhZ2R.es-D9R-vmeu.js +0 -1
  66. package/dist/app/assets/css-D1aVdRIU.es-BPhBrDlE.js +0 -1
  67. package/dist/app/assets/csv-DvCncUGQ.es-C-TU5hQ_.js +0 -1
  68. package/dist/app/assets/cue-BXMrmvay.es-DtFQj3wx.js +0 -1
  69. package/dist/app/assets/cypher-DTm5zNR1.es-m2LEI-9-.js +0 -1
  70. package/dist/app/assets/d-D6ZXmn3l.es-BoXegm-a.js +0 -1
  71. package/dist/app/assets/dark-plus-pUHDTVV0.es-C3mMm8J8.js +0 -1
  72. package/dist/app/assets/dart-Dz59Is3F.es-B9wLZaAG.js +0 -1
  73. package/dist/app/assets/dax-DTVGzydb.es-ClGRhx96.js +0 -1
  74. package/dist/app/assets/desktop-Db9vb-dl.es-DEIpsLCJ.js +0 -1
  75. package/dist/app/assets/diff-XmNrvgM1.es-BgYniUM_.js +0 -1
  76. package/dist/app/assets/docker-DWH2onkn.es-COcR7UxN.js +0 -1
  77. package/dist/app/assets/dotenv-4337wvzu.es-BjQB5zDj.js +0 -1
  78. package/dist/app/assets/dracula-BtZx2Kac.es-BzJJZx-M.js +0 -1
  79. package/dist/app/assets/dracula-soft-BKa-aqBv.es-BXkSAIEj.js +0 -1
  80. package/dist/app/assets/dream-maker-CvvfrJSx.es-C-nORZOA.js +0 -1
  81. package/dist/app/assets/edge-DI6_BHKG.es-CysQ3joS.js +0 -1
  82. package/dist/app/assets/elixir-ic9y5jcd.es-BhdVfZIc.js +0 -1
  83. package/dist/app/assets/elm-DxnUqUaW.es-BM2_y8XT.js +0 -1
  84. package/dist/app/assets/emacs-lisp-BAefI874.es-BX77sIaO.js +0 -1
  85. package/dist/app/assets/erb-Cbj2YePa.es-DRu4t7o3.js +0 -1
  86. package/dist/app/assets/erlang-CmIiwF3I.es-B-DoSBHF.js +0 -1
  87. package/dist/app/assets/everforest-dark-DMCBqXCK.es-BgDCqdQA.js +0 -1
  88. package/dist/app/assets/everforest-light-BbXl82Em.es-C8M2exoo.js +0 -1
  89. package/dist/app/assets/fennel-DNqkz9pE.es-bCA53EVm.js +0 -1
  90. package/dist/app/assets/fish-DIm72t2T.es-w-ucz2PV.js +0 -1
  91. package/dist/app/assets/fluent-BapTxJsC.es-Dayu4EKP.js +0 -1
  92. package/dist/app/assets/fortran-fixed-form-DECY15PY.es-DU-ZL2d9.js +0 -1
  93. package/dist/app/assets/fortran-free-form-CNDsBFUj.es-DKXYxT9g.js +0 -1
  94. package/dist/app/assets/fsharp-D2ZqviWP.es-BxlBxsP5.js +0 -1
  95. package/dist/app/assets/gdresource-RIsK8sku.es-B20oF6eU.js +0 -1
  96. package/dist/app/assets/gdscript-D7aheHm-.es-DfxzS6Rs.js +0 -1
  97. package/dist/app/assets/gdshader-BGJEsM2Z.es-SKMF96pI.js +0 -1
  98. package/dist/app/assets/genie-C9gPjc6J.es-ajMbGru0.js +0 -1
  99. package/dist/app/assets/gherkin-bka1Exbx.es--30QC5Em.js +0 -1
  100. package/dist/app/assets/git-commit-BRJ1E4Bx.es-BbGpbqw6.js +0 -1
  101. package/dist/app/assets/git-rebase-C3X7aMpn.es-BtbFLN_-.js +0 -1
  102. package/dist/app/assets/github-dark-DenFmJkN.es-DHJKELXO.js +0 -1
  103. package/dist/app/assets/github-dark-default-BJPUVz4H.es-Cuk6v7N8.js +0 -1
  104. package/dist/app/assets/github-dark-dimmed-DUshB20C.es-DH5Ifo-i.js +0 -1
  105. package/dist/app/assets/github-dark-high-contrast-D3aGCnF8.es-E3gJ1_iC.js +0 -1
  106. package/dist/app/assets/github-light-JYsPkUQd.es-DAi9KRSo.js +0 -1
  107. package/dist/app/assets/github-light-default-D99KPAby.es-D7oLnXFd.js +0 -1
  108. package/dist/app/assets/github-light-high-contrast-BbmZE-Mp.es-BfjtVDDH.js +0 -1
  109. package/dist/app/assets/gleam-B4k9YFGD.es-B430Bg39.js +0 -1
  110. package/dist/app/assets/glimmer-js-C4MQf3Na.es-BEVrinj1.js +0 -1
  111. package/dist/app/assets/glimmer-ts-CoYpqZrZ.es-BREYyOZ9.js +0 -1
  112. package/dist/app/assets/glsl-BYTq1Tfl.es-ELtdM8O0.js +0 -1
  113. package/dist/app/assets/gnuplot-DnWoRZt-.es-CM8KxXT1.js +0 -1
  114. package/dist/app/assets/go-BErP6iv1.es-B1SYOhNW.js +0 -1
  115. package/dist/app/assets/graphql-g3nHRc0M.es-DSxiSR3X.js +0 -1
  116. package/dist/app/assets/groovy-IWs5-NIO.es-DkBy-JyN.js +0 -1
  117. package/dist/app/assets/hack-wPAsyujS.es-BZgRSYeF.js +0 -1
  118. package/dist/app/assets/haml-4TJ757dz.es-DgP9dPqU.js +0 -1
  119. package/dist/app/assets/handlebars-7GDLw__F.es-9gasINI1.js +0 -1
  120. package/dist/app/assets/haskell-CtlGos0K.es-BILxekzW.js +0 -1
  121. package/dist/app/assets/haxe-CZZ33vZw.es-C5wWYbrZ.js +0 -1
  122. package/dist/app/assets/hcl-6hOg9WP4.es-HzYwdGDm.js +0 -1
  123. package/dist/app/assets/hjson-CgwED-oz.es-T-Tgc4AT.js +0 -1
  124. package/dist/app/assets/hlsl-3-lv4gi7.es-ifBTmRxC.js +0 -1
  125. package/dist/app/assets/houston-BDYrDoDW.es-DnULxvSX.js +0 -1
  126. package/dist/app/assets/html-PSPajZka.es-BayZgXUb.js +0 -1
  127. package/dist/app/assets/html-derivative-Brb3b4aI.es-BOeRDW72.js +0 -1
  128. package/dist/app/assets/http-CWBcr-Ch.es-BydQIEc3.js +0 -1
  129. package/dist/app/assets/hxml-DLduiIv3.es-KtyOMmRZ.js +0 -1
  130. package/dist/app/assets/hy-C2xHhR6I.es-BMj5Y0dO.js +0 -1
  131. package/dist/app/assets/imba-BEYqRZzB.es-CMdLgtbc.js +0 -1
  132. package/dist/app/assets/index-CpcugJHa.js +0 -447
  133. package/dist/app/assets/ini-BUcvsX-U.es-BjABl1g7.js +0 -1
  134. package/dist/app/assets/java-B7odJ7Ap.es-xI-RfyKK.js +0 -1
  135. package/dist/app/assets/javascript-fa8UlHZE.es-ySlJ1b_l.js +0 -1
  136. package/dist/app/assets/jinja-DKLHYjK0.es-Bc5vrI9a.js +0 -1
  137. package/dist/app/assets/jison-CzPfUIvM.es-FIbl5Mke.js +0 -1
  138. package/dist/app/assets/json-71t8ZF9g.es-BQoSv7ci.js +0 -1
  139. package/dist/app/assets/json5-Z7F6rA6a.es-w8dY5SsB.js +0 -1
  140. package/dist/app/assets/jsonc-Dphhs4m2.es-TU54ms6u.js +0 -1
  141. package/dist/app/assets/jsonl-D9jj92Gg.es-DREVFZK8.js +0 -1
  142. package/dist/app/assets/jsonnet-DEQ7IUoJ.es-BfivnA6A.js +0 -1
  143. package/dist/app/assets/jssm-j74e88UX.es-P4WzXJd0.js +0 -1
  144. package/dist/app/assets/jsx-Bkesy5tT.es-BAng5TT0.js +0 -1
  145. package/dist/app/assets/julia-B_r6juN7.es-UTBdB3hN.js +0 -1
  146. package/dist/app/assets/kanagawa-dragon-CiKur4Hl.es-CkXjmgJE.js +0 -1
  147. package/dist/app/assets/kanagawa-lotus-BKu-smKu.es-CfQXZHmo.js +0 -1
  148. package/dist/app/assets/kanagawa-wave-CQwozSzG.es-DWedfzmr.js +0 -1
  149. package/dist/app/assets/kotlin-DCgZY7Ii.es-B5lbUyaz.js +0 -1
  150. package/dist/app/assets/kusto-Cw029H-v.es-mebxcVVE.js +0 -1
  151. package/dist/app/assets/laserwave-6a00oqik.es-DUszq2jm.js +0 -1
  152. package/dist/app/assets/latex-GxBxlqbc.es-BIcleNUg.js +0 -1
  153. package/dist/app/assets/lean-CYSet4vs.es-XBlWyCtg.js +0 -1
  154. package/dist/app/assets/less-DQA4v-Nm.es-BfCpw3nA.js +0 -1
  155. package/dist/app/assets/light-plus-CZuVqSLX.es-B7mTdjB0.js +0 -1
  156. package/dist/app/assets/liquid-BxBkR-z5.es-BPU8qCnT.js +0 -1
  157. package/dist/app/assets/log-D2eRfqDn.es-Cc5clBb7.js +0 -1
  158. package/dist/app/assets/logo-QEAtGWZ9.es-IuBKFhSY.js +0 -1
  159. package/dist/app/assets/lua-DeXVjwzF.es-Dr4fCD2G.js +0 -1
  160. package/dist/app/assets/luau-BjYGiqID.es-Du5NY7AG.js +0 -1
  161. package/dist/app/assets/make-BjuHP00g.es-Bvotw-X0.js +0 -1
  162. package/dist/app/assets/markdown-B6guhLWd.es-UIAJJxZW.js +0 -1
  163. package/dist/app/assets/marko-DwPYPpB3.es-DWcUhJ8-.js +0 -1
  164. package/dist/app/assets/material-theme-D6KBX41T.es-D5KoaKCx.js +0 -1
  165. package/dist/app/assets/material-theme-darker-CkRroheE.es-BfHTSMKl.js +0 -1
  166. package/dist/app/assets/material-theme-lighter-BUBw43Yz.es-B0m2ddpp.js +0 -1
  167. package/dist/app/assets/material-theme-ocean-ClGX14Ja.es-CyktbL80.js +0 -1
  168. package/dist/app/assets/material-theme-palenight-C1RVm8K1.es-Csfq5Kiy.js +0 -1
  169. package/dist/app/assets/matlab-BpQlIJiw.es-D9-PGadD.js +0 -1
  170. package/dist/app/assets/mdc-X4YjkufV.es-CkjSLJEI.js +0 -1
  171. package/dist/app/assets/mdx-DIoECIFU.es-sdHcTMYB.js +0 -1
  172. package/dist/app/assets/mermaid-BZ7WHNIe.es-Ci6OQyBP.js +0 -1
  173. package/dist/app/assets/min-dark-C7ak0t6c.es-CafNBF8u.js +0 -1
  174. package/dist/app/assets/min-light-CKFxVcPp.es-CTRr51gU.js +0 -1
  175. package/dist/app/assets/mipsasm-DusDYkFc.es-BC5c_5Pe.js +0 -1
  176. package/dist/app/assets/mojo-CY9jaezJ.es-Tz6hzZYG.js +0 -1
  177. package/dist/app/assets/monokai-C1KBYcO0.es-D4h5O-jR.js +0 -1
  178. package/dist/app/assets/move-ChphFumd.es-DB_GagMm.js +0 -1
  179. package/dist/app/assets/narrat-Dz4d7OmN.es-DLbgOhZU.js +0 -1
  180. package/dist/app/assets/nextflow-DW0Yq9a2.es-B0XVJmRM.js +0 -1
  181. package/dist/app/assets/nginx-ChI-VqNT.es-DWZcbbz-.js +0 -1
  182. package/dist/app/assets/night-owl-Bm2rzalh.es-C39BiMTA.js +0 -1
  183. package/dist/app/assets/nim-BiJA-5u7.es-znXiz4wV.js +0 -1
  184. package/dist/app/assets/nix-Cg5uV_xg.es-shcSOmrb.js +0 -1
  185. package/dist/app/assets/nord-CC5OiUXg.es-Ddv68eIx.js +0 -1
  186. package/dist/app/assets/nushell-BfRnzRWn.es-D4Tzg5kh.js +0 -1
  187. package/dist/app/assets/objective-c-BGg9R27G.es-Deuh7S70.js +0 -1
  188. package/dist/app/assets/objective-cpp-CJ3y3V_5.es-BUEGK8hf.js +0 -1
  189. package/dist/app/assets/ocaml-BZLsfx_o.es-BNioltXt.js +0 -1
  190. package/dist/app/assets/one-dark-pro-D7-kP8fv.es-GBQ2dnAY.js +0 -1
  191. package/dist/app/assets/one-light-D9sNaUtq.es-PoHY5YXO.js +0 -1
  192. package/dist/app/assets/pascal-l2bqd7Dz.es-JqZropPD.js +0 -1
  193. package/dist/app/assets/perl-CkXYjL3t.es-BGcPZ9HO.js +0 -1
  194. package/dist/app/assets/php-q40Yjh5d.es-BkXnuPYP.js +0 -1
  195. package/dist/app/assets/plastic-CSTz3KZp.es-3e1v2bzS.js +0 -1
  196. package/dist/app/assets/plsql-oVq_K_wH.es-LKU2TuZ1.js +0 -1
  197. package/dist/app/assets/po-5jaeIyVd.es-BFLt1xDp.js +0 -1
  198. package/dist/app/assets/poimandres-C-VADXHD.es-CS3Unz2-.js +0 -1
  199. package/dist/app/assets/polar-wcLp8ci7.es-DKykz6zU.js +0 -1
  200. package/dist/app/assets/postcss-BZ3MNRIJ.es-B3ZDOciz.js +0 -1
  201. package/dist/app/assets/powerquery-CgRa2XRw.es-CSHBycmS.js +0 -1
  202. package/dist/app/assets/powershell-Diwyv8Eh.es-BIEUsx6d.js +0 -1
  203. package/dist/app/assets/prisma-COL_v1x4.es-B48N-Iqd.js +0 -1
  204. package/dist/app/assets/prolog-CuvJOxqT.es-BY-TUvya.js +0 -1
  205. package/dist/app/assets/proto-o9HLmF90.es-zocC4JxJ.js +0 -1
  206. package/dist/app/assets/pug-Br4hpvIv.es-DSNbVJpq.js +0 -1
  207. package/dist/app/assets/puppet-wpGOnQp5.es-Cza_XSSt.js +0 -1
  208. package/dist/app/assets/purescript-B_1NgE2N.es-Bg-kzb6g.js +0 -1
  209. package/dist/app/assets/python-xYxLFJY-.es-DhUJRlN_.js +0 -1
  210. package/dist/app/assets/qml-D5gi21kK.es-DPPvKkcg.js +0 -1
  211. package/dist/app/assets/qmldir-BInDYbpo.es-C8lEn-DE.js +0 -1
  212. package/dist/app/assets/qss-D-h4NdUG.es-DhMKtDLN.js +0 -1
  213. package/dist/app/assets/r-F-9I-ITZ.es-CwjWoCRV.js +0 -1
  214. package/dist/app/assets/racket-BoD1TBFT.es-CzouJOBO.js +0 -1
  215. package/dist/app/assets/raku-IaYcw19m.es-B1bQXN8T.js +0 -1
  216. package/dist/app/assets/razor-Bt_t1YJb.es-CZnAzo4o.js +0 -1
  217. package/dist/app/assets/red-7y8PH7HH.es-bN70gL4F.js +0 -1
  218. package/dist/app/assets/reg-CMUdAgIP.es-5LuOXUq_.js +0 -1
  219. package/dist/app/assets/regexp-GiFkbxS-.es-DWJ3fJO_.js +0 -1
  220. package/dist/app/assets/rel-BaRn3QX7.es-DJlmqQ1C.js +0 -1
  221. package/dist/app/assets/riscv-B9V3SsvW.es-QhoSD0DR.js +0 -1
  222. package/dist/app/assets/rose-pine-DhT-HZE9.es-CmCqftbK.js +0 -1
  223. package/dist/app/assets/rose-pine-dawn-DiCjL2i4.es-Ds-gbosJ.js +0 -1
  224. package/dist/app/assets/rose-pine-moon-BNmGHlcn.es-CjDtw9vr.js +0 -1
  225. package/dist/app/assets/rst-BmKw97ch.es-CR4pK9fb.js +0 -1
  226. package/dist/app/assets/ruby-cs7BSa_9.es-CPbNUT0O.js +0 -1
  227. package/dist/app/assets/rust-Pc7DCsZD.es-Be6lgOlo.js +0 -1
  228. package/dist/app/assets/sas-DgvHx4mL.es-CucEgNpN.js +0 -1
  229. package/dist/app/assets/sass-iCyS6eP9.es-BJ4Li9vH.js +0 -1
  230. package/dist/app/assets/scala-Cly-fENF.es-DQVVAn-B.js +0 -1
  231. package/dist/app/assets/scheme-Zi24oEYu.es-BJGe-b2p.js +0 -1
  232. package/dist/app/assets/scss-B_hSZppj.es-BurBaP11.js +0 -1
  233. package/dist/app/assets/sdbl-BBamrXFL.es-BLhTXw86.js +0 -1
  234. package/dist/app/assets/shaderlab-U9mqcu_f.es-BbQCwWDD.js +0 -1
  235. package/dist/app/assets/shellscript-Dn0-btNd.es-atvbtKCR.js +0 -1
  236. package/dist/app/assets/shellsession-LvXGClmj.es-BA33EWkN.js +0 -1
  237. package/dist/app/assets/slack-dark-i7wN4OET.es-BthQWCQV.js +0 -1
  238. package/dist/app/assets/slack-ochin-ndHf0LoP.es-DqwNpetd.js +0 -1
  239. package/dist/app/assets/smalltalk-Cns31tKw.es-DkLiglaE.js +0 -1
  240. package/dist/app/assets/snazzy-light-BlSJXAu4.es-Bw305WKR.js +0 -1
  241. package/dist/app/assets/solarized-dark-UTmkh7lw.es-DXbdFlpD.js +0 -1
  242. package/dist/app/assets/solarized-light-BheCkDPT.es-L9t79GZl.js +0 -1
  243. package/dist/app/assets/solidity-BG_k8fA_.es-C1w2a3ep.js +0 -1
  244. package/dist/app/assets/soy-C0yEn39K.es-BwliuvcW.js +0 -1
  245. package/dist/app/assets/sparql-CuZaxpno.es-DA2vjzn9.js +0 -1
  246. package/dist/app/assets/splunk-CTqDjQdo.es-Cf8iN4DR.js +0 -1
  247. package/dist/app/assets/sql-DCkt643-.es-COK4E0Yg.js +0 -1
  248. package/dist/app/assets/ssh-config-DHHGll-v.es-BknIz3MU.js +0 -1
  249. package/dist/app/assets/stata-Dv81f34z.es-CMwo8ydZ.js +0 -1
  250. package/dist/app/assets/stylus-n_9f0QQ5.es-BeQkCIfX.js +0 -1
  251. package/dist/app/assets/svelte-SoJd35Jr.es-CClskEeK.js +0 -1
  252. package/dist/app/assets/swift-BAWqNR8A.es-BSxZ-RaX.js +0 -1
  253. package/dist/app/assets/synthwave-84-NU3C_KFZ.es-CbfX1IO0.js +0 -1
  254. package/dist/app/assets/system-verilog-Cui-g-ut.es-C7L56vO4.js +0 -1
  255. package/dist/app/assets/systemd-CsKYQIQK.es-CUnW07Te.js +0 -1
  256. package/dist/app/assets/talonscript-D2dGh8FO.es-C1XDQQGZ.js +0 -1
  257. package/dist/app/assets/tasl-D3W8HMV6.es-CQjiPCtT.js +0 -1
  258. package/dist/app/assets/tcl-2y0Fuc4S.es-DQ1-QYvQ.js +0 -1
  259. package/dist/app/assets/templ-C7he2afp.es-DoaZGgQ7.js +0 -1
  260. package/dist/app/assets/terraform-BGW6Oerf.es-BbSNqyBO.js +0 -1
  261. package/dist/app/assets/tex-B0y3cEZp.es-sNFHINbC.js +0 -1
  262. package/dist/app/assets/tokyo-night-LhP3hHhi.es-DBQeEorK.js +0 -1
  263. package/dist/app/assets/toml-CQSfOn0e.es-CB2ApiWb.js +0 -1
  264. package/dist/app/assets/ts-tags-C5-4VQhf.es-BAFqzONk.js +0 -1
  265. package/dist/app/assets/tsv-BtvSkaG0.es-B_m7g4N7.js +0 -1
  266. package/dist/app/assets/tsx-DiGsgWT8.es-B6W0miNI.js +0 -1
  267. package/dist/app/assets/turtle-BJ2wmjPc.es-BMR_PYu6.js +0 -1
  268. package/dist/app/assets/twig-OmkATFdv.es-Bjz-OhEW.js +0 -1
  269. package/dist/app/assets/typescript-buWNZFwO.es-Dj6nwHGl.js +0 -1
  270. package/dist/app/assets/typespec-bLbdsxJL.es-BpWG_bgh.js +0 -1
  271. package/dist/app/assets/typst-Y9_SmXTs.es-BVUVsWT6.js +0 -1
  272. package/dist/app/assets/v-wa8Orrdd.es-CAQ2eGtk.js +0 -1
  273. package/dist/app/assets/vala-DRdriFr_.es-BFOHcciG.js +0 -1
  274. package/dist/app/assets/vb-E2_-jk4M.es-CdO5JTpU.js +0 -1
  275. package/dist/app/assets/verilog-B1iBoR5_.es-CJaU5se_.js +0 -1
  276. package/dist/app/assets/vesper-CJsaOsSM.es-BEBZ7ncR.js +0 -1
  277. package/dist/app/assets/vhdl-CRVaAhXk.es-DYoNaHQp.js +0 -1
  278. package/dist/app/assets/viml-B-zWOd7Z.es-m4uW47V2.js +0 -1
  279. package/dist/app/assets/vitesse-black-BoGvW84i.es-Bkuqu6BP.js +0 -1
  280. package/dist/app/assets/vitesse-dark-Cym-eLtO.es-D0r3Knsf.js +0 -1
  281. package/dist/app/assets/vitesse-light-CcmG315c.es-CVO1_9PV.js +0 -1
  282. package/dist/app/assets/vue-DCwwWMGI.es-Ctq8hiPI.js +0 -1
  283. package/dist/app/assets/vue-html-sRE_Ny23.es-By6muIb_.js +0 -1
  284. package/dist/app/assets/vyper-DWutKXpa.es-nyqBNV6O.js +0 -1
  285. package/dist/app/assets/wasm-Bv5f0gKv.es-C6j12Q_x.js +0 -1
  286. package/dist/app/assets/wenyan-BMYnfus1.es-7A4Fjokl.js +0 -1
  287. package/dist/app/assets/wgsl-DnPoPGDU.es-CB0Krxn9.js +0 -1
  288. package/dist/app/assets/wikitext-CntM04PE.es-DCE3LsBG.js +0 -1
  289. package/dist/app/assets/wolfram-Ws5qPlX9.es-C3FkfJm5.js +0 -1
  290. package/dist/app/assets/xml-Ch1q_kJp.es-af2B2Zxm.js +0 -1
  291. package/dist/app/assets/xsl-DyL8yqXw.es-DIeMqyL3.js +0 -1
  292. package/dist/app/assets/yaml-Bbg74JKr.es-CVw76BM1.js +0 -1
  293. package/dist/app/assets/zenscript-C0RKE4nU.es-HnGAYVZD.js +0 -1
  294. package/dist/app/assets/zig-D6SXBGNm.es-BVz_zdnA.js +0 -1
package/dist/server.js CHANGED
@@ -133002,6 +133002,18 @@ class ModelController {
133002
133002
  }
133003
133003
  return model.getNotebook();
133004
133004
  }
133005
+ async executeNotebookCell(projectName, packageName, notebookPath, cellIndex) {
133006
+ const project = await this.projectStore.getProject(projectName, false);
133007
+ const p = await project.getPackage(packageName, false);
133008
+ const model = p.getModel(notebookPath);
133009
+ if (!model) {
133010
+ throw new ModelNotFoundError(`${notebookPath} does not exist`);
133011
+ }
133012
+ if (model.getType() === "model") {
133013
+ throw new ModelNotFoundError(`${notebookPath} is a model`);
133014
+ }
133015
+ return model.executeNotebookCell(cellIndex);
133016
+ }
133005
133017
  }
133006
133018
 
133007
133019
  // src/controller/package.controller.ts
@@ -139036,7 +139048,14 @@ class Model {
139036
139048
  return new Model(packageName, modelPath, dataStyles, modelType, modelMaterializer, modelDef, sources, queries, runnableNotebookCells, undefined);
139037
139049
  } catch (error) {
139038
139050
  let computedError = error;
139051
+ if (error instanceof Error && error.stack) {
139052
+ console.error("Error stack", error.stack);
139053
+ }
139039
139054
  if (error instanceof import_malloy2.MalloyError) {
139055
+ const problems = error.problems;
139056
+ for (const problem of problems) {
139057
+ console.error("Problem", problem);
139058
+ }
139040
139059
  computedError = new ModelCompilationError(error);
139041
139060
  }
139042
139061
  return new Model(packageName, modelPath, dataStyles, modelType, undefined, undefined, undefined, undefined, undefined, computedError);
@@ -139171,27 +139190,25 @@ run: ${sourceName ? sourceName + "->" : ""}${queryName}`);
139171
139190
  };
139172
139191
  }
139173
139192
  async getNotebookModel() {
139174
- const notebookCells = await Promise.all(this.runnableNotebookCells.map(async (cell) => {
139175
- let queryName = undefined;
139176
- let queryResult = undefined;
139177
- if (cell.runnable) {
139178
- try {
139179
- const rowLimit = (await cell.runnable.getPreparedResult()).resultExplore.limit || ROW_LIMIT;
139180
- const result = await cell.runnable.run({ rowLimit });
139181
- const query = (await cell.runnable.getPreparedQuery())._query;
139182
- queryName = query.as || query.name;
139183
- queryResult = result?._queryResult && this.modelInfo && JSON.stringify(import_malloy2.API.util.wrapResult(result));
139184
- } catch {
139185
- }
139186
- }
139193
+ const notebookCells = this.runnableNotebookCells.map((cell) => {
139194
+ console.log("cell.queryInfo", cell.queryInfo);
139187
139195
  return {
139188
139196
  type: cell.type,
139189
139197
  text: cell.text,
139190
- queryName,
139191
- result: queryResult,
139192
- newSources: cell.newSources?.map((source) => JSON.stringify(source))
139198
+ newSources: cell.newSources?.map((source) => JSON.stringify(source)),
139199
+ queryInfo: cell.queryInfo ? JSON.stringify(cell.queryInfo) : undefined
139193
139200
  };
139194
- }));
139201
+ });
139202
+ const allAnnotations = [];
139203
+ if (this.modelDef) {
139204
+ let currentAnnotation = this.modelDef.annotation;
139205
+ while (currentAnnotation) {
139206
+ if (currentAnnotation.notes) {
139207
+ allAnnotations.push(...currentAnnotation.notes.map((note) => note.text));
139208
+ }
139209
+ currentAnnotation = currentAnnotation.inherits;
139210
+ }
139211
+ }
139195
139212
  return {
139196
139213
  type: "notebook",
139197
139214
  packageName: this.packageName,
@@ -139200,9 +139217,61 @@ run: ${sourceName ? sourceName + "->" : ""}${queryName}`);
139200
139217
  modelInfo: JSON.stringify(this.modelDef ? import_malloy2.modelDefToModelInfo(this.modelDef) : {}),
139201
139218
  sources: this.modelDef && this.sources,
139202
139219
  queries: this.modelDef && this.queries,
139220
+ annotations: allAnnotations,
139203
139221
  notebookCells
139204
139222
  };
139205
139223
  }
139224
+ async executeNotebookCell(cellIndex) {
139225
+ if (this.compilationError) {
139226
+ throw this.compilationError;
139227
+ }
139228
+ if (!this.runnableNotebookCells) {
139229
+ throw new BadRequestError("No notebook cells available");
139230
+ }
139231
+ if (cellIndex < 0 || cellIndex >= this.runnableNotebookCells.length) {
139232
+ throw new BadRequestError(`Cell index ${cellIndex} out of range (0-${this.runnableNotebookCells.length - 1})`);
139233
+ }
139234
+ const cell = this.runnableNotebookCells[cellIndex];
139235
+ if (cell.type === "markdown") {
139236
+ return {
139237
+ type: cell.type,
139238
+ text: cell.text
139239
+ };
139240
+ }
139241
+ let queryName = undefined;
139242
+ let queryResult = undefined;
139243
+ if (cell.runnable) {
139244
+ try {
139245
+ const rowLimit = (await cell.runnable.getPreparedResult()).resultExplore.limit || ROW_LIMIT;
139246
+ const result = await cell.runnable.run({ rowLimit });
139247
+ const query = (await cell.runnable.getPreparedQuery())._query;
139248
+ queryName = query.as || query.name;
139249
+ queryResult = result?._queryResult && this.modelInfo && JSON.stringify(import_malloy2.API.util.wrapResult(result));
139250
+ } catch (error) {
139251
+ if (error instanceof import_malloy2.MalloyError) {
139252
+ throw error;
139253
+ }
139254
+ const errorMessage = error instanceof Error ? error.message : String(error);
139255
+ if (errorMessage.trim() === "Model has no queries.") {
139256
+ return {
139257
+ type: "code",
139258
+ text: cell.text
139259
+ };
139260
+ } else {
139261
+ console.log("Error message: ", errorMessage);
139262
+ }
139263
+ console.log("Cell content: ", cellIndex, cell.type, cell.text);
139264
+ throw new BadRequestError(`Cell execution failed: ${errorMessage}`);
139265
+ }
139266
+ }
139267
+ return {
139268
+ type: cell.type,
139269
+ text: cell.text,
139270
+ queryName,
139271
+ result: queryResult,
139272
+ newSources: cell.newSources?.map((source) => JSON.stringify(source))
139273
+ };
139274
+ }
139206
139275
  static async getModelRuntime(packagePath, modelPath, connections) {
139207
139276
  const fullModelPath = path4.join(packagePath, modelPath);
139208
139277
  try {
@@ -139324,11 +139393,30 @@ run: ${sourceName ? sourceName + "->" : ""}${queryName}`);
139324
139393
  oldSources[source.name] = source;
139325
139394
  }
139326
139395
  const runnable = localMM.loadFinalQuery();
139396
+ let queryInfo = undefined;
139397
+ try {
139398
+ const preparedQuery = await runnable.getPreparedQuery();
139399
+ const query = preparedQuery._query;
139400
+ const queryName = query.as || query.name;
139401
+ const anonymousQuery = currentModelInfo.anonymous_queries[currentModelInfo.anonymous_queries.length - 1];
139402
+ if (anonymousQuery) {
139403
+ queryInfo = {
139404
+ name: queryName,
139405
+ schema: anonymousQuery.schema,
139406
+ annotations: anonymousQuery.annotations,
139407
+ definition: anonymousQuery.definition,
139408
+ code: anonymousQuery.code,
139409
+ location: anonymousQuery.location
139410
+ };
139411
+ }
139412
+ } catch (_error) {
139413
+ }
139327
139414
  return {
139328
139415
  type: "code",
139329
139416
  text: stmt.text,
139330
139417
  runnable,
139331
- newSources
139418
+ newSources,
139419
+ queryInfo
139332
139420
  };
139333
139421
  } else if (stmt.type === import_malloy_sql.MalloySQLStatementType.MARKDOWN) {
139334
139422
  return {
@@ -144712,8 +144800,8 @@ app.get(`${API_PREFIX2}/projects/:projectName/packages/:packageName/models/*?`,
144712
144800
  return;
144713
144801
  }
144714
144802
  try {
144715
- const zero = 0;
144716
- res.status(200).json(await modelController.getModel(req.params.projectName, req.params.packageName, req.params[zero]));
144803
+ const modelPath = req.params["0"];
144804
+ res.status(200).json(await modelController.getModel(req.params.projectName, req.params.packageName, modelPath));
144717
144805
  } catch (error) {
144718
144806
  logger2.error(error);
144719
144807
  const { json: json2, status } = internalErrorToHttpError(error);
@@ -144733,14 +144821,35 @@ app.get(`${API_PREFIX2}/projects/:projectName/packages/:packageName/notebooks`,
144733
144821
  res.status(status).json(json2);
144734
144822
  }
144735
144823
  });
144824
+ app.get(`${API_PREFIX2}/projects/:projectName/packages/:packageName/notebooks/*/cells/:cellIndex`, async (req, res) => {
144825
+ if (req.query.versionId) {
144826
+ setVersionIdError(res);
144827
+ return;
144828
+ }
144829
+ try {
144830
+ const cellIndex = parseInt(req.params.cellIndex, 10);
144831
+ if (isNaN(cellIndex)) {
144832
+ res.status(400).json({
144833
+ error: "Invalid cell index"
144834
+ });
144835
+ return;
144836
+ }
144837
+ const notebookPath = req.params["0"];
144838
+ res.status(200).json(await modelController.executeNotebookCell(req.params.projectName, req.params.packageName, notebookPath, cellIndex));
144839
+ } catch (error) {
144840
+ logger2.error(error);
144841
+ const { json: json2, status } = internalErrorToHttpError(error);
144842
+ res.status(status).json(json2);
144843
+ }
144844
+ });
144736
144845
  app.get(`${API_PREFIX2}/projects/:projectName/packages/:packageName/notebooks/*?`, async (req, res) => {
144737
144846
  if (req.query.versionId) {
144738
144847
  setVersionIdError(res);
144739
144848
  return;
144740
144849
  }
144741
144850
  try {
144742
- const zero = 0;
144743
- res.status(200).json(await modelController.getNotebook(req.params.projectName, req.params.packageName, req.params[zero]));
144851
+ const notebookPath = req.params["0"];
144852
+ res.status(200).json(await modelController.getNotebook(req.params.projectName, req.params.packageName, notebookPath));
144744
144853
  } catch (error) {
144745
144854
  logger2.error(error);
144746
144855
  const { json: json2, status } = internalErrorToHttpError(error);
@@ -144753,8 +144862,8 @@ app.post(`${API_PREFIX2}/projects/:projectName/packages/:packageName/models/*?/q
144753
144862
  return;
144754
144863
  }
144755
144864
  try {
144756
- const zero = 0;
144757
- res.status(200).json(await queryController.getQuery(req.params.projectName, req.params.packageName, req.params[zero], req.body.sourceName, req.body.queryName, req.body.query));
144865
+ const modelPath = req.params["0"];
144866
+ res.status(200).json(await queryController.getQuery(req.params.projectName, req.params.packageName, modelPath, req.body.sourceName, req.body.queryName, req.body.query));
144758
144867
  } catch (error) {
144759
144868
  logger2.error(error);
144760
144869
  const { json: json2, status } = internalErrorToHttpError(error);
@@ -144782,7 +144891,7 @@ app.use((err, _req, res, _next) => {
144782
144891
  const { json: json2, status } = internalErrorToHttpError(err);
144783
144892
  res.status(status).json(json2);
144784
144893
  });
144785
- var mainServer = http2.createServer(app);
144894
+ var mainServer = http2.createServer({ maxHeaderSize: 262144 }, app);
144786
144895
  mainServer.timeout = 600000;
144787
144896
  mainServer.keepAliveTimeout = 600000;
144788
144897
  mainServer.headersTimeout = 600000;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@malloy-publisher/server",
3
3
  "description": "Malloy Publisher Server",
4
- "version": "0.0.137",
4
+ "version": "0.0.139",
5
5
  "main": "dist/server.js",
6
6
  "bin": {
7
7
  "malloy-publisher": "dist/server.js"
@@ -5,7 +5,7 @@ import { ProjectStore } from "../service/project_store";
5
5
  type ApiNotebook = components["schemas"]["Notebook"];
6
6
  type ApiModel = components["schemas"]["Model"];
7
7
  type ApiCompiledModel = components["schemas"]["CompiledModel"];
8
- type ApiCompiledNotebook = components["schemas"]["CompiledNotebook"];
8
+ type ApiRawNotebook = components["schemas"]["RawNotebook"];
9
9
  export type ListModelsFilterEnum =
10
10
  components["parameters"]["ListModelsFilterEnum"];
11
11
  export class ModelController {
@@ -54,7 +54,7 @@ export class ModelController {
54
54
  projectName: string,
55
55
  packageName: string,
56
56
  notebookPath: string,
57
- ): Promise<ApiCompiledNotebook> {
57
+ ): Promise<ApiRawNotebook> {
58
58
  const project = await this.projectStore.getProject(projectName, false);
59
59
  const p = await project.getPackage(packageName, false);
60
60
  const model = p.getModel(notebookPath);
@@ -67,4 +67,29 @@ export class ModelController {
67
67
 
68
68
  return model.getNotebook();
69
69
  }
70
+
71
+ public async executeNotebookCell(
72
+ projectName: string,
73
+ packageName: string,
74
+ notebookPath: string,
75
+ cellIndex: number,
76
+ ): Promise<{
77
+ type: "code" | "markdown";
78
+ text: string;
79
+ queryName?: string;
80
+ result?: string;
81
+ newSources?: string[];
82
+ }> {
83
+ const project = await this.projectStore.getProject(projectName, false);
84
+ const p = await project.getPackage(packageName, false);
85
+ const model = p.getModel(notebookPath);
86
+ if (!model) {
87
+ throw new ModelNotFoundError(`${notebookPath} does not exist`);
88
+ }
89
+ if (model.getType() === "model") {
90
+ throw new ModelNotFoundError(`${notebookPath} is a model`);
91
+ }
92
+
93
+ return model.executeNotebookCell(cellIndex);
94
+ }
70
95
  }
@@ -82,9 +82,9 @@ export function registerNotebookResource(
82
82
  throw new McpGetResourceError(errorDetails);
83
83
  }
84
84
 
85
- // Now try to compile/get the actual notebook content
86
- const notebookContent: components["schemas"]["CompiledNotebook"] =
87
- await modelInstance.getNotebook(); // This can throw ModelCompilationError
85
+ // Now try to get the actual notebook content
86
+ const notebookContent: components["schemas"]["RawNotebook"] =
87
+ await modelInstance.getNotebook();
88
88
  return notebookContent;
89
89
  } catch (error) {
90
90
  if (error instanceof McpGetResourceError) {
package/src/server.ts CHANGED
@@ -653,12 +653,13 @@ app.get(
653
653
  }
654
654
 
655
655
  try {
656
- const zero = 0 as unknown;
656
+ // Express stores wildcard matches in params['0']
657
+ const modelPath = (req.params as Record<string, string>)["0"];
657
658
  res.status(200).json(
658
659
  await modelController.getModel(
659
660
  req.params.projectName,
660
661
  req.params.packageName,
661
- req.params[zero as keyof typeof req.params],
662
+ modelPath,
662
663
  ),
663
664
  );
664
665
  } catch (error) {
@@ -692,6 +693,44 @@ app.get(
692
693
  },
693
694
  );
694
695
 
696
+ // Execute notebook cell route must come BEFORE the general get notebook route
697
+ // to avoid the wildcard matching incorrectly
698
+ app.get(
699
+ `${API_PREFIX}/projects/:projectName/packages/:packageName/notebooks/*/cells/:cellIndex`,
700
+ async (req, res) => {
701
+ if (req.query.versionId) {
702
+ setVersionIdError(res);
703
+ return;
704
+ }
705
+
706
+ try {
707
+ const cellIndex = parseInt(req.params.cellIndex, 10);
708
+ if (isNaN(cellIndex)) {
709
+ res.status(400).json({
710
+ error: "Invalid cell index",
711
+ });
712
+ return;
713
+ }
714
+
715
+ // Express stores wildcard matches in params['0']
716
+ const notebookPath = (req.params as Record<string, string>)["0"];
717
+
718
+ res.status(200).json(
719
+ await modelController.executeNotebookCell(
720
+ req.params.projectName,
721
+ req.params.packageName,
722
+ notebookPath,
723
+ cellIndex,
724
+ ),
725
+ );
726
+ } catch (error) {
727
+ logger.error(error);
728
+ const { json, status } = internalErrorToHttpError(error as Error);
729
+ res.status(status).json(json);
730
+ }
731
+ },
732
+ );
733
+
695
734
  app.get(
696
735
  `${API_PREFIX}/projects/:projectName/packages/:packageName/notebooks/*?`,
697
736
  async (req, res) => {
@@ -701,12 +740,13 @@ app.get(
701
740
  }
702
741
 
703
742
  try {
704
- const zero = 0 as unknown;
743
+ // Express stores wildcard matches in params['0']
744
+ const notebookPath = (req.params as Record<string, string>)["0"];
705
745
  res.status(200).json(
706
746
  await modelController.getNotebook(
707
747
  req.params.projectName,
708
748
  req.params.packageName,
709
- req.params[zero as keyof typeof req.params],
749
+ notebookPath,
710
750
  ),
711
751
  );
712
752
  } catch (error) {
@@ -726,12 +766,13 @@ app.post(
726
766
  }
727
767
 
728
768
  try {
729
- const zero = 0 as unknown;
769
+ // Express stores wildcard matches in params['0']
770
+ const modelPath = (req.params as Record<string, string>)["0"];
730
771
  res.status(200).json(
731
772
  await queryController.getQuery(
732
773
  req.params.projectName,
733
774
  req.params.packageName,
734
- req.params[zero as keyof typeof req.params],
775
+ modelPath,
735
776
  req.body.sourceName as string,
736
777
  req.body.queryName as string,
737
778
  req.body.query as string,
@@ -786,7 +827,7 @@ app.use(
786
827
  },
787
828
  );
788
829
 
789
- const mainServer = http.createServer(app);
830
+ const mainServer = http.createServer({ maxHeaderSize: 262144 }, app);
790
831
 
791
832
  mainServer.timeout = 600000;
792
833
  mainServer.keepAliveTimeout = 600000;
@@ -1,9 +1,12 @@
1
1
  import {
2
+ Annotation,
2
3
  API,
3
4
  Connection,
4
5
  FixedConnectionMap,
6
+ isSourceDef,
5
7
  MalloyError,
6
8
  ModelDef,
9
+ modelDefToModelInfo,
7
10
  ModelMaterializer,
8
11
  NamedModelObject,
9
12
  NamedQuery,
@@ -11,8 +14,6 @@ import {
11
14
  Runtime,
12
15
  StructDef,
13
16
  TurtleDef,
14
- isSourceDef,
15
- modelDefToModelInfo,
16
17
  } from "@malloydata/malloy";
17
18
  import * as Malloy from "@malloydata/malloy-interfaces";
18
19
  import {
@@ -41,7 +42,7 @@ import { URL_READER } from "../utils";
41
42
 
42
43
  type ApiCompiledModel = components["schemas"]["CompiledModel"];
43
44
  type ApiNotebookCell = components["schemas"]["NotebookCell"];
44
- type ApiCompiledNotebook = components["schemas"]["CompiledNotebook"];
45
+ type ApiRawNotebook = components["schemas"]["RawNotebook"];
45
46
  // @ts-expect-error TODO: Fix missing Source type in API
46
47
  type ApiSource = components["schemas"]["Source"];
47
48
  type ApiView = components["schemas"]["View"];
@@ -61,6 +62,7 @@ interface RunnableNotebookCell {
61
62
  text: string;
62
63
  runnable?: QueryMaterializer;
63
64
  newSources?: Malloy.SourceInfo[];
65
+ queryInfo?: Malloy.QueryInfo;
64
66
  }
65
67
 
66
68
  export class Model {
@@ -155,7 +157,15 @@ export class Model {
155
157
  );
156
158
  } catch (error) {
157
159
  let computedError = error;
160
+ if (error instanceof Error && error.stack) {
161
+ console.error("Error stack", error.stack);
162
+ }
163
+
158
164
  if (error instanceof MalloyError) {
165
+ const problems = error.problems;
166
+ for (const problem of problems) {
167
+ console.error("Problem", problem);
168
+ }
159
169
  computedError = new ModelCompilationError(error);
160
170
  }
161
171
  return new Model(
@@ -215,7 +225,7 @@ export class Model {
215
225
  return this.compilationError;
216
226
  }
217
227
 
218
- public async getNotebook(): Promise<ApiCompiledNotebook> {
228
+ public async getNotebook(): Promise<ApiRawNotebook> {
219
229
  if (this.compilationError) {
220
230
  throw this.compilationError;
221
231
  }
@@ -341,42 +351,42 @@ export class Model {
341
351
  } as ApiCompiledModel;
342
352
  }
343
353
 
344
- private async getNotebookModel(): Promise<ApiCompiledNotebook> {
345
- const notebookCells: ApiNotebookCell[] = await Promise.all(
346
- (this.runnableNotebookCells as RunnableNotebookCell[]).map(
347
- async (cell) => {
348
- let queryName: string | undefined = undefined;
349
- let queryResult: string | undefined = undefined;
350
- if (cell.runnable) {
351
- try {
352
- const rowLimit =
353
- (await cell.runnable.getPreparedResult()).resultExplore
354
- .limit || ROW_LIMIT;
355
- const result = await cell.runnable.run({ rowLimit });
356
- const query = (await cell.runnable.getPreparedQuery())
357
- ._query;
358
- queryName = (query as NamedQuery).as || query.name;
359
- queryResult =
360
- result?._queryResult &&
361
- this.modelInfo &&
362
- JSON.stringify(API.util.wrapResult(result));
363
- } catch {
364
- // Catch block intentionally left empty as per previous logic review.
365
- // Error handling for specific cases might be added here if needed.
366
- }
367
- }
368
- return {
369
- type: cell.type,
370
- text: cell.text,
371
- queryName: queryName,
372
- result: queryResult,
373
- newSources: cell.newSources?.map((source) =>
374
- JSON.stringify(source),
375
- ),
376
- } as ApiNotebookCell;
377
- },
378
- ),
379
- );
354
+ private async getNotebookModel(): Promise<ApiRawNotebook> {
355
+ // Return raw cell contents without executing them
356
+ const notebookCells: ApiNotebookCell[] = (
357
+ this.runnableNotebookCells as RunnableNotebookCell[]
358
+ ).map((cell) => {
359
+ console.log("cell.queryInfo", cell.queryInfo);
360
+ return {
361
+ type: cell.type,
362
+ text: cell.text,
363
+ newSources: cell.newSources?.map((source) =>
364
+ JSON.stringify(source),
365
+ ),
366
+ queryInfo: cell.queryInfo
367
+ ? JSON.stringify(cell.queryInfo)
368
+ : undefined,
369
+ } as ApiNotebookCell;
370
+ });
371
+
372
+ // Collect all annotations from the inherits chain
373
+ const allAnnotations: string[] = [];
374
+ if (this.modelDef) {
375
+ // Traverse the inherits chain to collect all annotations
376
+ // Type as Annotation to handle the inherits chain properly
377
+ let currentAnnotation: Annotation | undefined =
378
+ this.modelDef.annotation;
379
+
380
+ while (currentAnnotation) {
381
+ if (currentAnnotation.notes) {
382
+ allAnnotations.push(
383
+ ...currentAnnotation.notes.map((note) => note.text),
384
+ );
385
+ }
386
+ // Navigate to the inherited annotation if it exists
387
+ currentAnnotation = currentAnnotation.inherits;
388
+ }
389
+ }
380
390
 
381
391
  return {
382
392
  type: "notebook",
@@ -388,8 +398,84 @@ export class Model {
388
398
  ),
389
399
  sources: this.modelDef && this.sources,
390
400
  queries: this.modelDef && this.queries,
401
+ annotations: allAnnotations,
391
402
  notebookCells,
392
- } as ApiCompiledModel;
403
+ } as ApiRawNotebook;
404
+ }
405
+
406
+ public async executeNotebookCell(cellIndex: number): Promise<{
407
+ type: "code" | "markdown";
408
+ text: string;
409
+ queryName?: string;
410
+ result?: string;
411
+ newSources?: string[];
412
+ }> {
413
+ if (this.compilationError) {
414
+ throw this.compilationError;
415
+ }
416
+
417
+ if (!this.runnableNotebookCells) {
418
+ throw new BadRequestError("No notebook cells available");
419
+ }
420
+
421
+ if (cellIndex < 0 || cellIndex >= this.runnableNotebookCells.length) {
422
+ throw new BadRequestError(
423
+ `Cell index ${cellIndex} out of range (0-${this.runnableNotebookCells.length - 1})`,
424
+ );
425
+ }
426
+
427
+ const cell = this.runnableNotebookCells[cellIndex];
428
+
429
+ if (cell.type === "markdown") {
430
+ return {
431
+ type: cell.type,
432
+ text: cell.text,
433
+ };
434
+ }
435
+
436
+ // For code cells, execute the runnable if available
437
+ let queryName: string | undefined = undefined;
438
+ let queryResult: string | undefined = undefined;
439
+
440
+ if (cell.runnable) {
441
+ try {
442
+ const rowLimit =
443
+ (await cell.runnable.getPreparedResult()).resultExplore.limit ||
444
+ ROW_LIMIT;
445
+ const result = await cell.runnable.run({ rowLimit });
446
+ const query = (await cell.runnable.getPreparedQuery())._query;
447
+ queryName = (query as NamedQuery).as || query.name;
448
+ queryResult =
449
+ result?._queryResult &&
450
+ this.modelInfo &&
451
+ JSON.stringify(API.util.wrapResult(result));
452
+ } catch (error) {
453
+ // Re-throw execution errors so the client knows about them
454
+ if (error instanceof MalloyError) {
455
+ throw error;
456
+ }
457
+ const errorMessage =
458
+ error instanceof Error ? error.message : String(error);
459
+ if (errorMessage.trim() === "Model has no queries.") {
460
+ return {
461
+ type: "code",
462
+ text: cell.text,
463
+ };
464
+ } else {
465
+ console.log("Error message: ", errorMessage);
466
+ }
467
+ console.log("Cell content: ", cellIndex, cell.type, cell.text);
468
+ throw new BadRequestError(`Cell execution failed: ${errorMessage}`);
469
+ }
470
+ }
471
+
472
+ return {
473
+ type: cell.type,
474
+ text: cell.text,
475
+ queryName: queryName,
476
+ result: queryResult,
477
+ newSources: cell.newSources?.map((source) => JSON.stringify(source)),
478
+ };
393
479
  }
394
480
 
395
481
  static async getModelRuntime(
@@ -644,11 +730,38 @@ export class Model {
644
730
 
645
731
  const runnable = localMM.loadFinalQuery();
646
732
 
733
+ // Extract QueryInfo from the runnable
734
+ let queryInfo: Malloy.QueryInfo | undefined = undefined;
735
+ try {
736
+ const preparedQuery = await runnable.getPreparedQuery();
737
+ const query = preparedQuery._query as NamedQuery;
738
+ const queryName = query.as || query.name;
739
+ const anonymousQuery =
740
+ currentModelInfo.anonymous_queries[
741
+ currentModelInfo.anonymous_queries.length - 1
742
+ ];
743
+
744
+ if (anonymousQuery) {
745
+ queryInfo = {
746
+ name: queryName,
747
+ schema: anonymousQuery.schema,
748
+ annotations: anonymousQuery.annotations,
749
+ definition: anonymousQuery.definition,
750
+ code: anonymousQuery.code,
751
+ location: anonymousQuery.location,
752
+ } as Malloy.QueryInfo;
753
+ }
754
+ } catch (_error) {
755
+ // If we can't extract query info (e.g., no query in cell), that's okay
756
+ // This can happen for cells that only define sources
757
+ }
758
+
647
759
  return {
648
760
  type: "code",
649
761
  text: stmt.text,
650
762
  runnable: runnable,
651
763
  newSources,
764
+ queryInfo,
652
765
  } as RunnableNotebookCell;
653
766
  } else if (stmt.type === MalloySQLStatementType.MARKDOWN) {
654
767
  return {
@@ -1 +0,0 @@
1
- import{G as o,j as a,N as e}from"./index-CpcugJHa.js";function n(){const t=o();return a.jsx(e,{onClickProject:t})}export{n as default};