quantology-modelmaker 0.3.2__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.
- {quantology_modelmaker-0.3.2/quantology_modelmaker.egg-info → quantology_modelmaker-0.3.3}/PKG-INFO +1 -1
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/App.tsx +34 -6
- quantology_modelmaker-0.3.3/frontend/src/LibraryPage.tsx +65 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/LibraryPanel.tsx +24 -8
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/Toolbar.tsx +46 -14
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/host.ts +9 -2
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/main.tsx +3 -1
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/agent/prompts.py +6 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/api.py +10 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/assistant_api.py +116 -1
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/assistant_mcp.py +25 -1
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/blocks/_template.py +5 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/llm/prompts.py +18 -1
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/session.py +24 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/pyproject.toml +1 -1
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3/quantology_modelmaker.egg-info}/PKG-INFO +1 -1
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/quantology_modelmaker.egg-info/SOURCES.txt +1 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_agent_foundations.py +10 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_assistant_mcp.py +18 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_embedding.py +80 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/LICENSE +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/MANIFEST.in +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/NOTICE +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/README.md +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/.gitignore +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/.npmrc +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/.oxlintrc.json +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/README.md +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/index.html +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/package-lock.json +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/package.json +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/public/brand-quantology/favicon.svg +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/public/brand-quantology/icon-mark-light.svg +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/public/icons.svg +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/scripts/check-host.mjs +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/BlockNode.tsx +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/BuildPanel.tsx +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/BuildReport.tsx +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/CodeEditor.tsx +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/DataModal.tsx +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/DataPicker.tsx +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/DataWireEdge.tsx +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/EnvVarField.tsx +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/FileBrowser.tsx +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/GhostNode.tsx +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/GitPanel.tsx +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/Inspector.tsx +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/LaneBand.tsx +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/LaneLabels.tsx +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/NodeDisplay.tsx +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/Palette.tsx +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/ParamsForm.tsx +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/PortDataView.tsx +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/PortInspector.tsx +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/SettingsPanel.tsx +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/UpdateDialog.tsx +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/api.ts +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/assets/hero.png +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/assets/react.svg +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/assets/vite.svg +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/features.ts +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/index.css +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/roles.ts +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/src/types.ts +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/tsconfig.app.json +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/tsconfig.json +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/tsconfig.node.json +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/frontend/vite.config.ts +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/__init__.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/__main__.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/agent/__init__.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/agent/build.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/agent/catalogue.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/agent/controller.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/agent/hint_rules.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/agent/hints.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/agent/layout.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/agent/leakage.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/agent/loop.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/agent/mcp_server.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/agent/tools.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/block_library.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/blocks/__init__.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/blocks/base.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/blocks/binning.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/blocks/data_quality.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/blocks/feature_analysis.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/blocks/library.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/blocks/modelling.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/blocks/stat_tests.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/blocks/stochastic.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/cache.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/capabilities.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/cli.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/compiler.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/datasets.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/demo_data.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/execution/__init__.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/execution/agent.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/execution/base.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/execution/env.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/execution/limits.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/execution/local.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/execution/protocol.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/execution/remote.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/execution/safe_pickle.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/execution/wire.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/features.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/forms.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/gitops.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/graph.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/library_ai.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/library_api.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/library_store.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/library_updates.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/llm/__init__.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/llm/anthropic_provider.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/llm/base.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/llm/claude_cli_provider.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/llm/copilot_provider.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/llm/gemini_provider.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/llm/lmstudio_provider.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/llm/openai_provider.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/llm/redact.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/llm/settings.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/llm/stub_provider.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/metadata_transforms.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/packet.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/project.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/run_worker.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/runner.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/runslot.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/signature.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/sources.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/stochastic/__init__.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/stochastic/accumulate.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/stochastic/credit.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/stochastic/dependency.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/stochastic/distributions.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/stochastic/proxy.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/stochastic/seed.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/stochastic/var_covar.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/tui/__init__.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/tui/app.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/tui/canvas.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/tui/charts.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/tui/client.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/tui/inspector.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/tui/paramspecs.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/tui/preview.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/tui/screens.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/util.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/worker_pool.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/modelmaker/workspace.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/projects/demo_pd_model/model.json +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/quantology_modelmaker.egg-info/dependency_links.txt +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/quantology_modelmaker.egg-info/entry_points.txt +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/quantology_modelmaker.egg-info/requires.txt +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/quantology_modelmaker.egg-info/top_level.txt +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/run.bat +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/setup.cfg +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/setup.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_agent_api.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_agent_build.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_agent_hints.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_agent_leakage.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_agent_loops.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_api.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_binning.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_block_library.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_cache.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_compiler.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_data_quality.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_datasets.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_demo_data.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_demo_project.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_display_blocks.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_env_vars.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_execution_agent.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_execution_executor.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_execution_limits.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_execution_security.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_execution_wire.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_feature_analysis.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_features.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_forms.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_gitops.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_graph.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_hosting_hooks.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_input_blocks.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_library.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_llm.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_llm_connections.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_master_scale.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_modelling.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_no_exec_in_api.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_packet.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_prep_blocks.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_project.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_risk_parameter_blocks.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_runner.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_runner_streaming.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_session.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_stat_tests.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_stochastic_blocks.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_stochastic_core.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_stochastic_credit.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_stochastic_fan_out.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_stochastic_runner.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_tui_app.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_tui_charts.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_tui_client.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_validation_blocks.py +0 -0
- {quantology_modelmaker-0.3.2 → quantology_modelmaker-0.3.3}/tests/test_workspaces.py +0 -0
|
@@ -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={() =>
|
|
763
|
-
onCreateWithAI={() =>
|
|
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
|
-
{
|
|
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) =>
|
|
875
|
-
onOpenInLibrary={(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
|
|
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=
|
|
149
|
+
role={page ? 'main' : 'dialog'}
|
|
140
150
|
aria-label={title}
|
|
141
|
-
style={
|
|
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
|
-
|
|
172
|
-
|
|
173
|
-
|
|
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
|
)}
|
|
@@ -401,7 +417,8 @@ export function Toolbar({
|
|
|
401
417
|
)
|
|
402
418
|
}
|
|
403
419
|
|
|
404
|
-
|
|
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
|
-
<
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
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
|
|
@@ -367,7 +367,8 @@ def list_files(r: Resolver, a: dict[str, Any]) -> Any:
|
|
|
367
367
|
"list_block_types",
|
|
368
368
|
"Without a tag: the block tags (data_sources and exports first, then e.g. data_prep, sampling, binning_woe, "
|
|
369
369
|
"regression, performance, stability) with a description of each. With a tag: that tag's blocks (category id and "
|
|
370
|
-
"one-sentence summary), built-ins and the user's library. Use describe_block_type before adding one."
|
|
370
|
+
"one-sentence summary), built-ins and the user's library. Use describe_block_type before adding one. If no "
|
|
371
|
+
"block does what's needed, write one for the library: get_block_guide.",
|
|
371
372
|
{"tag": {"type": "string", "description": "A tag from the tag list."}},
|
|
372
373
|
)
|
|
373
374
|
def list_block_types(r: Resolver, a: dict[str, Any]) -> Any:
|
|
@@ -432,6 +433,29 @@ def check(r: Resolver, a: dict[str, Any]) -> Any:
|
|
|
432
433
|
return t.get("/assistant/check", block=target)
|
|
433
434
|
|
|
434
435
|
|
|
436
|
+
@tool(
|
|
437
|
+
"get_block_guide",
|
|
438
|
+
"How to write a new block (or change one) for the user's block library, when no built-in block does what's "
|
|
439
|
+
"needed: the library folder to write the .py file into, the files already there, the rules (including how "
|
|
440
|
+
"to handle data too big for memory: lazy scans, reduce early, streaming collect) and the commented "
|
|
441
|
+
"template. Call this before writing or editing a block file, then check_block_file.",
|
|
442
|
+
)
|
|
443
|
+
def get_block_guide(r: Resolver, a: dict[str, Any]) -> Any:
|
|
444
|
+
return r.target().get("/assistant/block_guide")
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
@tool(
|
|
448
|
+
"check_block_file",
|
|
449
|
+
"Checks a block file you wrote in the library folder: re-reads the folder, validates the file (the BLOCKS "
|
|
450
|
+
"entry, the functions, the params) and runs its _example_ self-checks. Fix what it reports until ok, then "
|
|
451
|
+
"place the block with add_block (its id as the category).",
|
|
452
|
+
{"name": {"type": "string", "description": "The file's name in the library folder, e.g. fannie_mae.py."}},
|
|
453
|
+
["name"],
|
|
454
|
+
)
|
|
455
|
+
def check_block_file(r: Resolver, a: dict[str, Any]) -> Any:
|
|
456
|
+
return r.target().post("/assistant/check_block_file", {"name": a["name"]}, timeout=300)
|
|
457
|
+
|
|
458
|
+
|
|
435
459
|
@tool(
|
|
436
460
|
"add_lane",
|
|
437
461
|
"Adds a lane: a labelled horizontal band that groups one phase of the model (e.g. Data, Sampling, Binning, "
|
|
@@ -33,6 +33,11 @@ BLOCKS = {
|
|
|
33
33
|
# means the function returns a pl.LazyFrame (the engine collects it).
|
|
34
34
|
# "aggregate": True marks an output as a statistics table (one row
|
|
35
35
|
# per feature/bin/grade/..., never per record).
|
|
36
|
+
# Large sources: an input block returns pl.scan_csv/scan_parquet
|
|
37
|
+
# (lazy output), select only the needed columns and reduce early;
|
|
38
|
+
# collect inside a block only after reducing, with
|
|
39
|
+
# .collect(engine="streaming"). See "Large data" in
|
|
40
|
+
# docs/block-authoring.md.
|
|
36
41
|
"inputs": [{"name": "df", "type": "dataframe", "lazy": True}],
|
|
37
42
|
"outputs": [{"name": "out", "type": "dataframe"}],
|
|
38
43
|
# Params form fields worth a label, placeholder or options; every
|