quantology-modelmaker 0.3.0__tar.gz → 0.3.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. {quantology_modelmaker-0.3.0/quantology_modelmaker.egg-info → quantology_modelmaker-0.3.3}/PKG-INFO +10 -5
  2. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/README.md +9 -4
  3. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/App.tsx +34 -6
  4. quantology_modelmaker-0.3.3/frontend/src/LibraryPage.tsx +65 -0
  5. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/LibraryPanel.tsx +24 -8
  6. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/Toolbar.tsx +47 -15
  7. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/host.ts +9 -2
  8. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/main.tsx +3 -1
  9. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/agent/prompts.py +6 -0
  10. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/api.py +10 -0
  11. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/assistant_api.py +116 -1
  12. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/assistant_mcp.py +26 -15
  13. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/blocks/_template.py +5 -0
  14. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/llm/prompts.py +18 -1
  15. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/runner.py +17 -18
  16. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/session.py +24 -0
  17. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/pyproject.toml +1 -1
  18. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3/quantology_modelmaker.egg-info}/PKG-INFO +10 -5
  19. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/quantology_modelmaker.egg-info/SOURCES.txt +1 -0
  20. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_agent_foundations.py +10 -0
  21. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_assistant_mcp.py +20 -2
  22. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_embedding.py +80 -0
  23. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_runner.py +26 -3
  24. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/LICENSE +0 -0
  25. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/MANIFEST.in +0 -0
  26. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/NOTICE +0 -0
  27. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/.gitignore +0 -0
  28. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/.npmrc +0 -0
  29. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/.oxlintrc.json +0 -0
  30. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/README.md +0 -0
  31. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/index.html +0 -0
  32. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/package-lock.json +0 -0
  33. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/package.json +0 -0
  34. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/public/brand-quantology/favicon.svg +0 -0
  35. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/public/brand-quantology/icon-mark-light.svg +0 -0
  36. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/public/icons.svg +0 -0
  37. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/scripts/check-host.mjs +0 -0
  38. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/BlockNode.tsx +0 -0
  39. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/BuildPanel.tsx +0 -0
  40. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/BuildReport.tsx +0 -0
  41. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/CodeEditor.tsx +0 -0
  42. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/DataModal.tsx +0 -0
  43. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/DataPicker.tsx +0 -0
  44. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/DataWireEdge.tsx +0 -0
  45. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/EnvVarField.tsx +0 -0
  46. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/FileBrowser.tsx +0 -0
  47. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/GhostNode.tsx +0 -0
  48. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/GitPanel.tsx +0 -0
  49. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/Inspector.tsx +0 -0
  50. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/LaneBand.tsx +0 -0
  51. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/LaneLabels.tsx +0 -0
  52. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/NodeDisplay.tsx +0 -0
  53. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/Palette.tsx +0 -0
  54. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/ParamsForm.tsx +0 -0
  55. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/PortDataView.tsx +0 -0
  56. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/PortInspector.tsx +0 -0
  57. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/SettingsPanel.tsx +0 -0
  58. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/UpdateDialog.tsx +0 -0
  59. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/api.ts +0 -0
  60. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/assets/hero.png +0 -0
  61. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/assets/react.svg +0 -0
  62. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/assets/vite.svg +0 -0
  63. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/features.ts +0 -0
  64. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/index.css +0 -0
  65. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/roles.ts +0 -0
  66. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/src/types.ts +0 -0
  67. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/tsconfig.app.json +0 -0
  68. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/tsconfig.json +0 -0
  69. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/tsconfig.node.json +0 -0
  70. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/frontend/vite.config.ts +0 -0
  71. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/__init__.py +0 -0
  72. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/__main__.py +0 -0
  73. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/agent/__init__.py +0 -0
  74. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/agent/build.py +0 -0
  75. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/agent/catalogue.py +0 -0
  76. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/agent/controller.py +0 -0
  77. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/agent/hint_rules.py +0 -0
  78. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/agent/hints.py +0 -0
  79. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/agent/layout.py +0 -0
  80. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/agent/leakage.py +0 -0
  81. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/agent/loop.py +0 -0
  82. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/agent/mcp_server.py +0 -0
  83. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/agent/tools.py +0 -0
  84. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/block_library.py +0 -0
  85. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/blocks/__init__.py +0 -0
  86. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/blocks/base.py +0 -0
  87. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/blocks/binning.py +0 -0
  88. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/blocks/data_quality.py +0 -0
  89. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/blocks/feature_analysis.py +0 -0
  90. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/blocks/library.py +0 -0
  91. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/blocks/modelling.py +0 -0
  92. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/blocks/stat_tests.py +0 -0
  93. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/blocks/stochastic.py +0 -0
  94. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/cache.py +0 -0
  95. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/capabilities.py +0 -0
  96. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/cli.py +0 -0
  97. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/compiler.py +0 -0
  98. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/datasets.py +0 -0
  99. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/demo_data.py +0 -0
  100. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/execution/__init__.py +0 -0
  101. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/execution/agent.py +0 -0
  102. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/execution/base.py +0 -0
  103. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/execution/env.py +0 -0
  104. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/execution/limits.py +0 -0
  105. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/execution/local.py +0 -0
  106. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/execution/protocol.py +0 -0
  107. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/execution/remote.py +0 -0
  108. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/execution/safe_pickle.py +0 -0
  109. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/execution/wire.py +0 -0
  110. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/features.py +0 -0
  111. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/forms.py +0 -0
  112. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/gitops.py +0 -0
  113. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/graph.py +0 -0
  114. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/library_ai.py +0 -0
  115. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/library_api.py +0 -0
  116. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/library_store.py +0 -0
  117. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/library_updates.py +0 -0
  118. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/llm/__init__.py +0 -0
  119. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/llm/anthropic_provider.py +0 -0
  120. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/llm/base.py +0 -0
  121. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/llm/claude_cli_provider.py +0 -0
  122. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/llm/copilot_provider.py +0 -0
  123. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/llm/gemini_provider.py +0 -0
  124. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/llm/lmstudio_provider.py +0 -0
  125. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/llm/openai_provider.py +0 -0
  126. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/llm/redact.py +0 -0
  127. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/llm/settings.py +0 -0
  128. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/llm/stub_provider.py +0 -0
  129. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/metadata_transforms.py +0 -0
  130. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/packet.py +0 -0
  131. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/project.py +0 -0
  132. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/run_worker.py +0 -0
  133. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/runslot.py +0 -0
  134. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/signature.py +0 -0
  135. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/sources.py +0 -0
  136. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/stochastic/__init__.py +0 -0
  137. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/stochastic/accumulate.py +0 -0
  138. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/stochastic/credit.py +0 -0
  139. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/stochastic/dependency.py +0 -0
  140. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/stochastic/distributions.py +0 -0
  141. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/stochastic/proxy.py +0 -0
  142. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/stochastic/seed.py +0 -0
  143. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/stochastic/var_covar.py +0 -0
  144. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/tui/__init__.py +0 -0
  145. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/tui/app.py +0 -0
  146. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/tui/canvas.py +0 -0
  147. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/tui/charts.py +0 -0
  148. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/tui/client.py +0 -0
  149. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/tui/inspector.py +0 -0
  150. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/tui/paramspecs.py +0 -0
  151. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/tui/preview.py +0 -0
  152. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/tui/screens.py +0 -0
  153. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/util.py +0 -0
  154. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/worker_pool.py +0 -0
  155. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/modelmaker/workspace.py +0 -0
  156. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/projects/demo_pd_model/model.json +0 -0
  157. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/quantology_modelmaker.egg-info/dependency_links.txt +0 -0
  158. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/quantology_modelmaker.egg-info/entry_points.txt +0 -0
  159. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/quantology_modelmaker.egg-info/requires.txt +0 -0
  160. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/quantology_modelmaker.egg-info/top_level.txt +0 -0
  161. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/run.bat +0 -0
  162. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/setup.cfg +0 -0
  163. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/setup.py +0 -0
  164. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_agent_api.py +0 -0
  165. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_agent_build.py +0 -0
  166. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_agent_hints.py +0 -0
  167. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_agent_leakage.py +0 -0
  168. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_agent_loops.py +0 -0
  169. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_api.py +0 -0
  170. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_binning.py +0 -0
  171. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_block_library.py +0 -0
  172. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_cache.py +0 -0
  173. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_compiler.py +0 -0
  174. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_data_quality.py +0 -0
  175. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_datasets.py +0 -0
  176. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_demo_data.py +0 -0
  177. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_demo_project.py +0 -0
  178. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_display_blocks.py +0 -0
  179. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_env_vars.py +0 -0
  180. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_execution_agent.py +0 -0
  181. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_execution_executor.py +0 -0
  182. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_execution_limits.py +0 -0
  183. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_execution_security.py +0 -0
  184. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_execution_wire.py +0 -0
  185. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_feature_analysis.py +0 -0
  186. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_features.py +0 -0
  187. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_forms.py +0 -0
  188. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_gitops.py +0 -0
  189. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_graph.py +0 -0
  190. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_hosting_hooks.py +0 -0
  191. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_input_blocks.py +0 -0
  192. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_library.py +0 -0
  193. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_llm.py +0 -0
  194. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_llm_connections.py +0 -0
  195. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_master_scale.py +0 -0
  196. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_modelling.py +0 -0
  197. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_no_exec_in_api.py +0 -0
  198. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_packet.py +0 -0
  199. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_prep_blocks.py +0 -0
  200. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_project.py +0 -0
  201. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_risk_parameter_blocks.py +0 -0
  202. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_runner_streaming.py +0 -0
  203. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_session.py +0 -0
  204. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_stat_tests.py +0 -0
  205. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_stochastic_blocks.py +0 -0
  206. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_stochastic_core.py +0 -0
  207. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_stochastic_credit.py +0 -0
  208. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_stochastic_fan_out.py +0 -0
  209. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_stochastic_runner.py +0 -0
  210. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_tui_app.py +0 -0
  211. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_tui_charts.py +0 -0
  212. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_tui_client.py +0 -0
  213. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_validation_blocks.py +0 -0
  214. {quantology_modelmaker-0.3.0 → quantology_modelmaker-0.3.3}/tests/test_workspaces.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantology-modelmaker
3
- Version: 0.3.0
3
+ Version: 0.3.3
4
4
  Summary: Visual pipeline builder for financial model development
5
5
  Author-email: Maurits Malkus <10948172+mmalkus@users.noreply.github.com>
6
6
  License-Expression: Apache-2.0
@@ -107,10 +107,11 @@ it. It creates a `.venv` next to itself if missing, installs/upgrades
107
107
  ## VS Code
108
108
 
109
109
  The extension in [`vscode/`](vscode/README.md) opens a project's
110
- `model.json` as the canvas in an editor tab. It starts the same
111
- `modelmaker-api` from the selected Python interpreter, one backend per
112
- open project, and offers to `pip install` the package if it's missing. It
113
- can also offer your GitHub Copilot models as the `copilot` AI provider.
110
+ `model.json` as the canvas in an editor tab, one backend per open project.
111
+ Model-Maker ships inside the extension, which runs it in a Python
112
+ environment of its own: all it needs is Python 3.11+ and access to PyPI or
113
+ a company mirror for the open-source requirements. It can also offer your
114
+ GitHub Copilot models as the `copilot` AI provider.
114
115
  The pip package works on its own exactly as described here; the extension
115
116
  is another way to run it. See
116
117
  [`vscode-extension-plan.md`](vscode-extension-plan.md) for the design and
@@ -125,6 +126,10 @@ cd vscode && npm ci && npm run build
125
126
  code --extensionDevelopmentPath="$PWD" path/to/workspace
126
127
  ```
127
128
 
129
+ A development build has no bundled Model-Maker and runs the installed
130
+ package (`pip install -e .` above). To try the bundled one, run
131
+ `pip install build && python scripts/bundle-python.py` in `vscode/`.
132
+
128
133
  ## Claude Code and other MCP clients
129
134
 
130
135
  `modelmaker-mcp` gives an MCP client the tools to build a model on an open
@@ -55,10 +55,11 @@ it. It creates a `.venv` next to itself if missing, installs/upgrades
55
55
  ## VS Code
56
56
 
57
57
  The extension in [`vscode/`](vscode/README.md) opens a project's
58
- `model.json` as the canvas in an editor tab. It starts the same
59
- `modelmaker-api` from the selected Python interpreter, one backend per
60
- open project, and offers to `pip install` the package if it's missing. It
61
- can also offer your GitHub Copilot models as the `copilot` AI provider.
58
+ `model.json` as the canvas in an editor tab, one backend per open project.
59
+ Model-Maker ships inside the extension, which runs it in a Python
60
+ environment of its own: all it needs is Python 3.11+ and access to PyPI or
61
+ a company mirror for the open-source requirements. It can also offer your
62
+ GitHub Copilot models as the `copilot` AI provider.
62
63
  The pip package works on its own exactly as described here; the extension
63
64
  is another way to run it. See
64
65
  [`vscode-extension-plan.md`](vscode-extension-plan.md) for the design and
@@ -73,6 +74,10 @@ cd vscode && npm ci && npm run build
73
74
  code --extensionDevelopmentPath="$PWD" path/to/workspace
74
75
  ```
75
76
 
77
+ A development build has no bundled Model-Maker and runs the installed
78
+ package (`pip install -e .` above). To try the bundled one, run
79
+ `pip install build && python scripts/bundle-python.py` in `vscode/`.
80
+
76
81
  ## Claude Code and other MCP clients
77
82
 
78
83
  `modelmaker-mcp` gives an MCP client the tools to build a model on an open
@@ -100,6 +100,12 @@ function AppInner() {
100
100
  // The block library overlay (null: closed), the counter the palette
101
101
  // refetches the library on, and the block whose update dialog is open.
102
102
  const [libraryView, setLibraryView] = useState<LibraryView | null>(null)
103
+ // In VS Code the library is an editor tab of its own (vscode/src/library.ts);
104
+ // in the browser, a dialog over the canvas.
105
+ const openLibrary = useCallback((view: LibraryView) => {
106
+ if (host.kind === 'vscode') host.post('openLibrary', view)
107
+ else setLibraryView(view)
108
+ }, [])
103
109
  const [libraryVersion, setLibraryVersion] = useState(0)
104
110
  const [updateBlockId, setUpdateBlockId] = useState<string | null>(null)
105
111
  const [selectedPort, setSelectedPort] = useState<{ blockId: string; port: string; portType: PortType } | null>(null)
@@ -640,6 +646,26 @@ function AppInner() {
640
646
  [reload],
641
647
  )
642
648
 
649
+ // From the library's own tab (VS Code; see LibraryPage): place a block
650
+ // here, so it's in this canvas's undo history; open the update dialog;
651
+ // refresh the palette's library section.
652
+ useEffect(
653
+ () =>
654
+ host.onEvent(({ name, data }) => {
655
+ const d = (data ?? {}) as { file?: string; id?: string; category?: string; blockId?: string }
656
+ if (name === 'placeLibraryBlock' && d.file && d.id) addLibraryBlock(d.file, d.id).catch((e) => host.notify((e as Error).message))
657
+ else if (name === 'placeBuiltinBlock' && d.category) addBlock(d.category)
658
+ else if (name === 'openUpdate' && d.blockId) {
659
+ reload()
660
+ setUpdateBlockId(d.blockId)
661
+ } else if (name === 'libraryChanged') {
662
+ setLibraryVersion((v) => v + 1)
663
+ reload()
664
+ }
665
+ }),
666
+ [addBlock, addLibraryBlock, reload],
667
+ )
668
+
643
669
  const onDragOver = useCallback((e: React.DragEvent) => {
644
670
  if (!e.dataTransfer.types.includes('application/x-modelmaker-block')) return
645
671
  e.preventDefault()
@@ -696,6 +722,7 @@ function AppInner() {
696
722
  onRedo={redo}
697
723
  sampleRows={graph?.sample_rows ?? null}
698
724
  autosave={autosave}
725
+ onOpenLibrary={has('custom_blocks') ? () => openLibrary({ kind: 'browse' }) : undefined}
699
726
  />
700
727
  {graph?.sample_rows != null && (
701
728
  <div
@@ -759,8 +786,8 @@ function AppInner() {
759
786
  onToggle={lean ? togglePalette : undefined}
760
787
  onAdd={addBlock}
761
788
  onAddLibrary={(file, id) => addLibraryBlock(file, id).catch((e) => host.notify(e.message))}
762
- onOpenLibrary={() => setLibraryView({ kind: 'browse' })}
763
- onCreateWithAI={() => setLibraryView({ kind: 'ai', start: { addToCanvas: true, contextBlock: selectedBlockContext } })}
789
+ onOpenLibrary={() => openLibrary({ kind: 'browse' })}
790
+ onCreateWithAI={() => openLibrary({ kind: 'ai', start: { addToCanvas: true, contextBlock: selectedBlockContext } })}
764
791
  onAddLane={addLane}
765
792
  libraryVersion={libraryVersion}
766
793
  />
@@ -805,7 +832,8 @@ function AppInner() {
805
832
  AI is editing -- canvas read-only
806
833
  </span>
807
834
  )}
808
- {has('ai_builder') && (
835
+ {/* In VS Code the assistant beside the canvas (Copilot, Claude Code) builds. */}
836
+ {has('ai_builder') && !lean && (
809
837
  <button
810
838
  className={buildOpen ? undefined : 'brand-primary'}
811
839
  onClick={() => setBuildOpen((o) => !o)}
@@ -841,7 +869,7 @@ function AppInner() {
841
869
  )}
842
870
  </ReactFlow>
843
871
  </div>
844
- {graph && has('ai_builder') && (buildOpen || buildLive) && (
872
+ {graph && has('ai_builder') && !lean && (buildOpen || buildLive) && (
845
873
  // Kept mounted (just hidden) while a build is live, so it keeps
846
874
  // polling the build -- and the canvas -- with the panel closed.
847
875
  <div style={{ display: buildOpen ? 'flex' : 'none' }}>
@@ -871,8 +899,8 @@ function AppInner() {
871
899
  onChanged={reload}
872
900
  provider={llmSettings?.active_provider ?? null}
873
901
  onOpenUpdate={(b) => setUpdateBlockId(b.id)}
874
- onFixWithAI={(b) => setLibraryView({ kind: 'ai', start: { fixBlock: b.id } })}
875
- onOpenInLibrary={(file, id) => setLibraryView({ kind: 'browse', selected: { file, id } })}
902
+ onFixWithAI={(b) => openLibrary({ kind: 'ai', start: { fixBlock: b.id } })}
903
+ onOpenInLibrary={(file, id) => openLibrary({ kind: 'browse', selected: { file, id } })}
876
904
  />
877
905
  )}
878
906
  </div>
@@ -0,0 +1,65 @@
1
+ import { useCallback, useEffect, useState } from 'react'
2
+ import { api } from './api'
3
+ import { host } from './host'
4
+ import { LibraryPanel, type LibraryView } from './LibraryPanel'
5
+ import type { GraphOut } from './types'
6
+
7
+ // The block library in a VS Code editor tab of its own (Model-Maker: Open
8
+ // Block Library, or the canvas's Library button), on the same backend as
9
+ // its project's canvas. Whatever changes the canvas -- placing a block,
10
+ // opening the update dialog -- goes to the canvas through the extension
11
+ // (vscode/src/library.ts), so it lands in the canvas's undo history; then
12
+ // the canvas tab comes to the front.
13
+
14
+ const GRAPH_POLL_MS = 2000
15
+
16
+ export function LibraryPage() {
17
+ const [view, setView] = useState<{ key: number; view: LibraryView }>({
18
+ key: 0,
19
+ view: (host.initialLibraryView as LibraryView | undefined) ?? { kind: 'browse' },
20
+ })
21
+ const [graph, setGraph] = useState<GraphOut | null>(null)
22
+ const [provider, setProvider] = useState<string | null>(null)
23
+
24
+ const loadGraph = useCallback(() => {
25
+ api.graph().then(setGraph).catch(() => {})
26
+ }, [])
27
+
28
+ useEffect(() => {
29
+ loadGraph()
30
+ api
31
+ .llmSettings()
32
+ .then((s) => setProvider(s.active_provider ?? null))
33
+ .catch(() => setProvider(null))
34
+ // The canvas edits the same graph: keep what this page shows of it
35
+ // (where a block is placed, Fix with AI's block) current.
36
+ const id = setInterval(() => {
37
+ if (!document.hidden) loadGraph()
38
+ }, GRAPH_POLL_MS)
39
+ return () => clearInterval(id)
40
+ }, [loadGraph])
41
+
42
+ // Opened again from the canvas on another view (e.g. Fix with AI).
43
+ useEffect(
44
+ () =>
45
+ host.onEvent(({ name, data }) => {
46
+ if (name === 'libraryView') setView((v) => ({ key: v.key + 1, view: data as LibraryView }))
47
+ }),
48
+ [],
49
+ )
50
+
51
+ return (
52
+ <LibraryPanel
53
+ key={view.key}
54
+ page
55
+ initialView={view.view}
56
+ graph={graph}
57
+ provider={provider}
58
+ onClose={() => host.post('showCanvas')}
59
+ onLibraryChanged={() => host.post('libraryChanged')}
60
+ onPlace={async (file, id) => host.post('placeLibraryBlock', { file, id })}
61
+ onPlaceBuiltin={(category) => host.post('placeBuiltinBlock', { category })}
62
+ onOpenUpdate={(blockId) => host.post('openUpdate', { blockId })}
63
+ />
64
+ )
65
+ }
@@ -71,6 +71,7 @@ function fileToBase64(file: File): Promise<string> {
71
71
  * file, create or fix a block with AI, import and export. A full-screen
72
72
  * overlay over the canvas. */
73
73
  export function LibraryPanel({
74
+ page = false,
74
75
  initialView,
75
76
  graph,
76
77
  provider,
@@ -80,6 +81,9 @@ export function LibraryPanel({
80
81
  onPlaceBuiltin,
81
82
  onOpenUpdate,
82
83
  }: {
84
+ // A page of its own (VS Code's library tab) rather than a dialog over the
85
+ // canvas: no backdrop, no close button.
86
+ page?: boolean
83
87
  initialView: LibraryView
84
88
  graph: GraphOut | null
85
89
  provider: string | null
@@ -114,11 +118,11 @@ export function LibraryPanel({
114
118
 
115
119
  useEffect(() => {
116
120
  const onKey = (e: KeyboardEvent) => {
117
- if (e.key === 'Escape' && view.kind === 'browse') onClose()
121
+ if (e.key === 'Escape' && view.kind === 'browse' && !page) onClose()
118
122
  }
119
123
  window.addEventListener('keydown', onKey)
120
124
  return () => window.removeEventListener('keydown', onKey)
121
- }, [view.kind, onClose])
125
+ }, [view.kind, onClose, page])
122
126
 
123
127
  const title =
124
128
  view.kind === 'browse'
@@ -134,11 +138,21 @@ export function LibraryPanel({
134
138
  : 'Import blocks'
135
139
 
136
140
  return (
137
- <div style={{ position: 'fixed', inset: 0, background: 'rgba(11,35,64,0.35)', zIndex: 50, display: 'flex', padding: 24 }}>
141
+ <div
142
+ style={
143
+ page
144
+ ? { position: 'fixed', inset: 0, display: 'flex' }
145
+ : { position: 'fixed', inset: 0, background: 'rgba(11,35,64,0.35)', zIndex: 50, display: 'flex', padding: 24 }
146
+ }
147
+ >
138
148
  <div
139
- role="dialog"
149
+ role={page ? 'main' : 'dialog'}
140
150
  aria-label={title}
141
- style={{ flex: 1, background: 'var(--mm-bg-subtle-3)', borderRadius: 12, display: 'flex', flexDirection: 'column', overflow: 'hidden', boxShadow: '0 20px 50px rgba(11,35,64,0.3)' }}
151
+ style={
152
+ page
153
+ ? { flex: 1, background: 'var(--mm-bg-subtle-3)', display: 'flex', flexDirection: 'column', overflow: 'hidden' }
154
+ : { flex: 1, background: 'var(--mm-bg-subtle-3)', borderRadius: 12, display: 'flex', flexDirection: 'column', overflow: 'hidden', boxShadow: '0 20px 50px rgba(11,35,64,0.3)' }
155
+ }
142
156
  >
143
157
  <div style={{ display: 'flex', alignItems: 'center', gap: 8, padding: '12px 16px', borderBottom: '1px solid var(--mm-border)', background: 'var(--mm-bg)' }}>
144
158
  {view.kind !== 'browse' && (
@@ -168,9 +182,11 @@ export function LibraryPanel({
168
182
  </button>
169
183
  </>
170
184
  )}
171
- <button aria-label="Close" onClick={onClose}>
172
- ✕
173
- </button>
185
+ {!page && (
186
+ <button aria-label="Close" onClick={onClose}>
187
+ ✕
188
+ </button>
189
+ )}
174
190
  </div>
175
191
  {error && (
176
192
  <div style={{ background: 'var(--mm-error-bg)', color: 'var(--mm-error)', padding: '6px 16px', fontSize: 12 }}>
@@ -1,4 +1,4 @@
1
- import { useEffect, useState } from 'react'
1
+ import { Fragment, useEffect, useState } from 'react'
2
2
  import type { AutosaveStatus } from './App'
3
3
  import { api } from './api'
4
4
  import { CodeEditor } from './CodeEditor'
@@ -36,6 +36,7 @@ export function Toolbar({
36
36
  onRedo,
37
37
  sampleRows,
38
38
  autosave,
39
+ onOpenLibrary,
39
40
  }: {
40
41
  onChanged: () => void
41
42
  projectPath: string | null
@@ -54,6 +55,8 @@ export function Toolbar({
54
55
  onRedo: () => void
55
56
  sampleRows: number | null
56
57
  autosave: AutosaveStatus
58
+ // The block library (VS Code: its own tab); absent where custom blocks are off.
59
+ onOpenLibrary?: () => void
57
60
  }) {
58
61
  const [busy, setBusy] = useState(false)
59
62
  const [compiled, setCompiled] = useState<string | null>(null)
@@ -159,6 +162,11 @@ export function Toolbar({
159
162
  borderBottom: '1px solid rgba(11,35,64,0.1)',
160
163
  }}
161
164
  >
165
+ {lean && (
166
+ <a href="https://www.quantology.nl/" target="_blank" rel="noreferrer" title="Quantology Model Maker" style={{ display: 'flex', marginRight: 2 }}>
167
+ <img src={`${import.meta.env.BASE_URL}brand-quantology/icon-mark-light.svg`} alt="Quantology" width={20} height={20} style={{ display: 'block' }} />
168
+ </a>
169
+ )}
162
170
  {!lean && (
163
171
  <a
164
172
  href="https://www.quantology.nl/"
@@ -220,6 +228,11 @@ export function Toolbar({
220
228
  <button disabled={busy} onClick={() => doCompile()} title={lean ? 'Compile the pipeline to one Python script, opened in an editor tab' : undefined}>
221
229
  Compile
222
230
  </button>
231
+ {lean && onOpenLibrary && (
232
+ <button onClick={onOpenLibrary} title="Open the block library in a tab of its own">
233
+ Library
234
+ </button>
235
+ )}
223
236
  {lean ? (
224
237
  <div style={{ position: 'relative' }}>
225
238
  <button disabled={busy} onClick={() => setShowMore((m) => !m)} title="More run and compile options">
@@ -234,6 +247,9 @@ export function Toolbar({
234
247
  { label: 'Refresh sources', disabled: running, onClick: () => run(() => api.refreshAll()) },
235
248
  { label: 'Check all sources', disabled: running, onClick: () => run(() => api.checkAllSources()) },
236
249
  { label: 'Compile (streaming)', onClick: () => doCompile(true) },
250
+ { label: 'Quantology', href: 'https://www.quantology.nl/', divider: true },
251
+ { label: 'Model-Maker on GitHub', href: 'https://github.com/mmalkus/Model-Maker' },
252
+ { label: 'Apache 2.0 License', href: 'https://www.apache.org/licenses/LICENSE-2.0' },
237
253
  ]}
238
254
  />
239
255
  )}
@@ -263,7 +279,7 @@ export function Toolbar({
263
279
 
264
280
  <label
265
281
  style={{ display: 'inline-flex', alignItems: 'center', gap: 5, fontSize: 12, color: 'var(--brand-charcoal)' }}
266
- title="Run the whole pipeline on the first N rows of every source, for fast iteration. Sources need re-reading when this changes."
282
+ title="Run the whole pipeline on the first N rows of every source, for fast iteration. The next Run all re-reads the sources."
267
283
  >
268
284
  <input
269
285
  type="checkbox"
@@ -401,7 +417,8 @@ export function Toolbar({
401
417
  )
402
418
  }
403
419
 
404
- type MenuItem = { label: string; onClick: () => void; disabled?: boolean }
420
+ // An action, or a link (opened in the browser); `divider` starts a group.
421
+ type MenuItem = { label: string; onClick?: () => void; href?: string; disabled?: boolean; divider?: boolean }
405
422
 
406
423
  function MoreMenu({ items, onClose }: { items: MenuItem[]; onClose: () => void }) {
407
424
  return (
@@ -428,18 +445,33 @@ function MoreMenu({ items, onClose }: { items: MenuItem[]; onClose: () => void }
428
445
  }}
429
446
  >
430
447
  {items.map((item) => (
431
- <button
432
- key={item.label}
433
- role="menuitem"
434
- disabled={item.disabled}
435
- onClick={() => {
436
- onClose()
437
- item.onClick()
438
- }}
439
- style={{ textAlign: 'left', border: 'none', background: 'transparent' }}
440
- >
441
- {item.label}
442
- </button>
448
+ <Fragment key={item.label}>
449
+ {item.divider && <hr style={{ border: 'none', borderTop: '1px solid var(--mm-border)', margin: '4px 0', width: '100%' }} />}
450
+ {item.href ? (
451
+ <a
452
+ role="menuitem"
453
+ href={item.href}
454
+ target="_blank"
455
+ rel="noreferrer"
456
+ onClick={onClose}
457
+ style={{ padding: '4px 10px', fontSize: 12, textDecoration: 'none', color: 'inherit' }}
458
+ >
459
+ {item.label}
460
+ </a>
461
+ ) : (
462
+ <button
463
+ role="menuitem"
464
+ disabled={item.disabled}
465
+ onClick={() => {
466
+ onClose()
467
+ item.onClick?.()
468
+ }}
469
+ style={{ textAlign: 'left', border: 'none', background: 'transparent' }}
470
+ >
471
+ {item.label}
472
+ </button>
473
+ )}
474
+ </Fragment>
443
475
  ))}
444
476
  </div>
445
477
  </>
@@ -21,6 +21,10 @@ export type HostEvent = { name: string; data?: unknown }
21
21
 
22
22
  export interface Host {
23
23
  readonly kind: 'browser' | 'vscode'
24
+ // What this page shows: the canvas, or (in its own VS Code tab) the block
25
+ // library, opened on `initialLibraryView`.
26
+ readonly view: 'canvas' | 'library'
27
+ readonly initialLibraryView?: unknown
24
28
  // Prefix for every API URL: '' in the browser (same origin), the backend's
25
29
  // http://127.0.0.1:<port> in VS Code.
26
30
  readonly apiBase: string
@@ -48,7 +52,7 @@ export interface Host {
48
52
 
49
53
  declare global {
50
54
  interface Window {
51
- __MODELMAKER__?: { apiBase: string; token: string }
55
+ __MODELMAKER__?: { apiBase: string; token: string; view?: 'canvas' | 'library'; libraryView?: unknown }
52
56
  }
53
57
  }
54
58
 
@@ -67,6 +71,7 @@ function anchorDownload(href: string, name: string) {
67
71
 
68
72
  export const browserHost: Host = {
69
73
  kind: 'browser',
74
+ view: 'canvas',
70
75
  apiBase: '',
71
76
  authHeaders: () => ({}),
72
77
  withToken: (url) => url,
@@ -112,7 +117,7 @@ declare function acquireVsCodeApi(): VsCodeApi
112
117
  // {kind: 'post', name, data} (one-way)
113
118
  // extension -> webview {kind: 'response', id, ok, result | error}
114
119
  // {kind: 'event', name, data}
115
- function makeVsCodeHost(config: { apiBase: string; token: string }): Host {
120
+ function makeVsCodeHost(config: { apiBase: string; token: string; view?: 'canvas' | 'library'; libraryView?: unknown }): Host {
116
121
  const vscode = acquireVsCodeApi()
117
122
  const pending = new Map<number, { resolve: (v: unknown) => void; reject: (e: Error) => void }>()
118
123
  const listeners = new Set<(event: HostEvent) => void>()
@@ -155,6 +160,8 @@ function makeVsCodeHost(config: { apiBase: string; token: string }): Host {
155
160
 
156
161
  return {
157
162
  kind: 'vscode',
163
+ view: config.view ?? 'canvas',
164
+ initialLibraryView: config.libraryView,
158
165
  apiBase: config.apiBase,
159
166
  authHeaders,
160
167
  withToken: (url) => appendQuery(url, 'token', config.token),
@@ -3,13 +3,15 @@ import { createRoot } from 'react-dom/client'
3
3
  import './index.css'
4
4
  import App from './App.tsx'
5
5
  import { loadFeatures } from './features'
6
+ import { host } from './host'
7
+ import { LibraryPage } from './LibraryPage'
6
8
 
7
9
  // What this workspace offers decides which controls exist, so it's read
8
10
  // before the first render.
9
11
  void loadFeatures().finally(() =>
10
12
  createRoot(document.getElementById('root')!).render(
11
13
  <StrictMode>
12
- <App />
14
+ {host.view === 'library' ? <LibraryPage /> : <App />}
13
15
  </StrictMode>,
14
16
  ),
15
17
  )
@@ -78,6 +78,12 @@ with defaults. It returns one pl.DataFrame. Shared code may go in private \
78
78
  helper functions whose names start with _.
79
79
  - Use only polars (in scope as `pl`; import anything else inside the \
80
80
  function). No pandas, no I/O, no globals, no network.
81
+ - Inputs may be large (tens of millions of rows): write the block as polars \
82
+ expressions (select/filter/with_columns/group_by/join), select only the \
83
+ columns it needs, and reduce early (to one row per account, snapshot date or \
84
+ period); if it must collect a LazyFrame, do so only after reducing, with \
85
+ .collect(engine="streaming"). Never .to_pandas(), .iter_rows(), \
86
+ .map_elements() or Python loops over rows.
81
87
  - Never hardcode an existing input column's name in the body: take it as a \
82
88
  `<descriptive>_col` str parameter defaulted to the real column name (or \
83
89
  `<descriptive>_cols` for a list) and use pl.col(param). New columns you \
@@ -784,6 +784,16 @@ def project_default_dir() -> dict[str, str]:
784
784
  return {"path": _shown(projects_dir)}
785
785
 
786
786
 
787
+ @app.get("/api/project/disk_state")
788
+ def project_disk_state() -> dict[str, bool]:
789
+ """Whether model.json was changed on disk by something other than this
790
+ backend (`changed`), and whether the canvas has edits not yet saved
791
+ (`dirty`): lets the VS Code extension reload quietly after an outside
792
+ edit, ask only when that would discard work, and ignore its own saves."""
793
+ session = _session()
794
+ return {"changed": session.disk_changed(), "dirty": session.dirty}
795
+
796
+
787
797
  @app.post("/api/project/new")
788
798
  def new_project_ep() -> dict[str, Any]:
789
799
  """The 'New' toolbar button: discards the in-memory graph in favor of a
@@ -17,6 +17,7 @@ from . import capabilities, features
17
17
  from .agent import catalogue, leakage
18
18
  from .agent.hints import decision_hints
19
19
  from .agent.layout import DEFAULT_LANE_HEIGHT, Placer, next_lane_order
20
+ from .llm.prompts import LARGE_DATA_RULES
20
21
  from .agent.tools import is_statistics_output, leak_graph, summarize_value, suspicious_in_graph, table_rows
21
22
  from .packet import DataFramePacket
22
23
  from .blocks.base import BLOCK_REGISTRY
@@ -115,9 +116,34 @@ def _io_blocks(kind: str) -> list[dict[str, Any]]:
115
116
  spec = BLOCK_REGISTRY.get(category)
116
117
  if spec is not None and capabilities.allowed(spec):
117
118
  out.append({"category": category, "summary": catalogue._first_sentence(spec.summary or spec.display_name)})
119
+ if kind == "input":
120
+ # The user's own data-source blocks (the AI builder's catalogue
121
+ # leaves library input blocks out; here the user confirms each edit).
122
+ for file, d in _library_inputs():
123
+ out.append({"category": d.id, "summary": catalogue._first_sentence(d.summary or d.display_name), "library": file})
118
124
  return out
119
125
 
120
126
 
127
+ def _library_inputs():
128
+ """(file, definition) of each valid library input block this workspace allows."""
129
+ from . import library_store
130
+
131
+ if features.CUSTOM_BLOCKS not in _workspace().features:
132
+ return []
133
+ found = []
134
+ try:
135
+ files = library_store.list_files()
136
+ except library_store.LibraryError:
137
+ return []
138
+ for f in files:
139
+ if f.parsed.file_errors:
140
+ continue
141
+ for d in f.parsed.definitions:
142
+ if d.block_type == "input" and not f.parsed.errors.get(d.id) and d.id not in BLOCK_REGISTRY and capabilities.allowed(d):
143
+ found.append((f.name, d))
144
+ return found
145
+
146
+
121
147
  @router.get("/block_types")
122
148
  def block_types(tag: str | None = None) -> dict[str, Any]:
123
149
  """The tags, or the blocks with one tag (built-ins and the library)."""
@@ -166,6 +192,10 @@ def add_block(req: NewBlock) -> dict[str, Any]:
166
192
  from . import library_store
167
193
 
168
194
  spec = catalogue.lookup(req.category, True)
195
+ library_input = None
196
+ if spec is None:
197
+ library_input = next(((f, d) for f, d in _library_inputs() if d.id == req.category), None)
198
+ spec = library_input[1] if library_input else None
169
199
  if spec is None:
170
200
  raise HTTPException(400, f"unknown block category {req.category!r}{catalogue.unknown_category_hint(req.category, True)}")
171
201
  known = {p["name"] for p in catalogue.block_params(spec)}
@@ -177,7 +207,7 @@ def add_block(req: NewBlock) -> dict[str, Any]:
177
207
  if features.CUSTOM_BLOCKS not in _workspace().features:
178
208
  raise HTTPException(403, features.refusal(features.CUSTOM_BLOCKS))
179
209
  try:
180
- definition, ref = library_store.placeable(spec.origin, req.category)
210
+ definition, ref = library_store.placeable(library_input[0] if library_input else spec.origin, req.category)
181
211
  except library_store.LibraryError as e:
182
212
  raise HTTPException(400, str(e))
183
213
  session = _session()
@@ -277,3 +307,88 @@ def check(block: str | None = None) -> dict[str, Any]:
277
307
  "hints": hints,
278
308
  "ok": not leaks and not suspicious,
279
309
  }
310
+
311
+
312
+ # ---- writing library blocks: an assistant's guide and check ------------------
313
+
314
+ BLOCK_FILE_RULES = [
315
+ "A block file is one .py file in the library folder holding one or more blocks: a module docstring "
316
+ "(the file's heading in the library), `import polars as pl`, a `BLOCKS = {...}` dict literal keyed by block "
317
+ "id (read without running the file, so literals only), and for each id a top-level function of that name. "
318
+ "The template below shows every key, commented; start from it.",
319
+ "A function's first parameters are its input ports (named as in \"inputs\"), then its params, each with "
320
+ "a default. It returns one value per output port (a tuple for several).",
321
+ "Never hardcode an existing input column's name in the body: take it as a `<descriptive>_col` str param "
322
+ "defaulted to the real column name (`<descriptive>_cols` for a list). New columns get literal names via "
323
+ ".alias(...).",
324
+ "Only polars at module level; import numpy, scipy or sklearn inside the function that uses them. No "
325
+ "pandas, no network, no global state, and no file I/O except an input block reading its source.",
326
+ "Give each block an `_example_<id>()` self-check: build a tiny pl.DataFrame by hand, call the block, "
327
+ "assert something meaningful. check_block_file runs it.",
328
+ "Block ids are unique across the library and the built-ins. When you change a block, bump its "
329
+ "\"version\": copies already placed on a canvas then offer Update.",
330
+ "Large data: " + LARGE_DATA_RULES,
331
+ "When the file is written, call check_block_file with its name and fix what it reports until ok; then "
332
+ "place a block with add_block, its id as the category.",
333
+ ]
334
+
335
+
336
+ def _library_or_403():
337
+ from . import library_store
338
+
339
+ if features.CUSTOM_BLOCKS not in _workspace().features:
340
+ raise HTTPException(403, features.refusal(features.CUSTOM_BLOCKS))
341
+ return library_store
342
+
343
+
344
+ @router.get("/block_guide")
345
+ def block_guide() -> dict[str, Any]:
346
+ """How to write a block file for the user's library, for an assistant
347
+ that writes files itself (Claude Code): where the library is, what's in
348
+ it, the rules, and the commented template."""
349
+ from . import block_library as bl
350
+
351
+ store = _library_or_403()
352
+ files = []
353
+ for f in store.list_files(force=True):
354
+ files.append({"name": f.name, "blocks": [d.id for d in f.parsed.definitions], **({"errors": True} if not f.parsed.ok else {})})
355
+ return {
356
+ "library_dir": _workspace().shown(store.library_dir()),
357
+ "files": files,
358
+ "rules": BLOCK_FILE_RULES,
359
+ "template": bl.TEMPLATE_PATH.read_text(encoding="utf-8"),
360
+ "full_guide": "https://github.com/mmalkus/Model-Maker/blob/main/docs/block-authoring.md",
361
+ }
362
+
363
+
364
+ class CheckFile(BaseModel):
365
+ name: str # the file's name in the library folder, e.g. "fannie_mae.py"
366
+
367
+
368
+ @router.post("/check_block_file")
369
+ def check_block_file(req: CheckFile) -> dict[str, Any]:
370
+ """Re-reads the library folder, then checks one file there: parse and
371
+ validation errors per block, and its _example_ self-checks run (in a
372
+ worker process, never this one)."""
373
+ from . import block_library as bl
374
+
375
+ store = _library_or_403()
376
+ store.reload()
377
+ try:
378
+ f = store.get_file(req.name)
379
+ except store.LibraryError as e:
380
+ names = ", ".join(x.name for x in store.list_files()) or "none yet"
381
+ raise HTTPException(404, f"{e} (the library folder holds: {names})")
382
+ blocks = [{"id": d.id, "block_type": d.block_type, **({"errors": f.parsed.errors[d.id]} if f.parsed.errors.get(d.id) else {})} for d in f.parsed.definitions]
383
+ examples: dict[str, Any] = {}
384
+ if not f.parsed.file_errors and f.parsed.examples:
385
+ session = _workspace().session
386
+ examples = bl.run_examples(f.source, f.name, None, executor=session.runner.executor, env=_workspace().env_vars.snapshot())
387
+ ok = f.parsed.ok and all(r.get("ok") is not False for r in examples.values()) and bool(f.parsed.definitions)
388
+ out: dict[str, Any] = {"file": f.name, "ok": ok, "file_errors": f.parsed.file_errors, "blocks": blocks, "examples": examples}
389
+ missing = [d.id for d in f.parsed.definitions if d.id not in f.parsed.examples]
390
+ if missing:
391
+ out["missing_examples"] = missing
392
+ if ok:
393
+ out["next"] = "place a block with add_block, its id as the category"
394
+ return out