model-compose 0.3.7__tar.gz → 0.3.8__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.
- {model_compose-0.3.7 → model_compose-0.3.8}/PKG-INFO +1 -1
- {model_compose-0.3.7 → model_compose-0.3.8}/pyproject.toml +1 -1
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/component/base.py +6 -6
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/component/services/http_server.py +9 -5
- model_compose-0.3.8/src/mindor/core/component/services/mcp_server.py +68 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/component/services/shell.py +3 -15
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/compose/compose.py +1 -1
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/compose/manager.py +4 -4
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/controller/base.py +69 -11
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/controller/runtime/docker/docker.py +9 -3
- model_compose-0.3.8/src/mindor/core/controller/runtime/native/__init__.py +1 -0
- model_compose-0.3.8/src/mindor/core/controller/runtime/native/native.py +24 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/services/async_service.py +5 -0
- model_compose-0.3.8/src/mindor/dsl/schema/action/impl/mcp_server.py +9 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/impl/http_client.py +1 -1
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/impl/http_server.py +16 -8
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/impl/mcp_client.py +1 -1
- model_compose-0.3.8/src/mindor/dsl/schema/component/impl/mcp_server.py +27 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/impl/model/impl/summarization.py +1 -1
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/impl/model/impl/text_classification.py +1 -1
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/impl/model/impl/text_embedding.py +1 -1
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/impl/model/impl/text_generation.py +1 -1
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/impl/model/impl/translation.py +1 -1
- {model_compose-0.3.7 → model_compose-0.3.8}/src/model_compose.egg-info/PKG-INFO +1 -1
- {model_compose-0.3.7 → model_compose-0.3.8}/src/model_compose.egg-info/SOURCES.txt +2 -0
- model_compose-0.3.7/src/mindor/core/component/services/mcp_server.py +0 -27
- model_compose-0.3.7/src/mindor/dsl/schema/action/impl/mcp_server.py +0 -7
- model_compose-0.3.7/src/mindor/dsl/schema/component/impl/mcp_server.py +0 -9
- {model_compose-0.3.7 → model_compose-0.3.8}/LICENSE +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/README.md +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/setup.cfg +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/cli/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/cli/compose.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/component/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/component/component.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/component/context.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/component/services/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/component/services/http_client.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/component/services/mcp_client.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/component/services/model/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/component/services/model/base.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/component/services/model/model.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/component/services/model/tasks/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/component/services/model/tasks/summarization.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/component/services/model/tasks/text_classification.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/component/services/model/tasks/text_embedding.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/component/services/model/tasks/text_generation.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/component/services/model/tasks/translation.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/component/services/text_splitter.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/component/services/workflow.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/compose/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/controller/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/controller/controller.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/controller/runner/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/controller/runner/client.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/controller/runner/http_client.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/controller/runner/mcp_client.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/controller/runner/runner.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/controller/runtime/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/controller/runtime/docker/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/controller/runtime/docker/context/Dockerfile +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/controller/runtime/specs.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/controller/services/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/controller/services/http_server.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/controller/services/mcp_server.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/controller/webui/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/controller/webui/gradio.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/controller/webui/webui.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/gateway/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/gateway/base.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/gateway/gateway.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/gateway/services/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/gateway/services/http_tunnel.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/gateway/services/ssh_tunnel.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/listener/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/listener/base.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/listener/listener.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/listener/services/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/listener/services/http_callback.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/logger/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/logger/base.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/logger/logger.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/logger/logging.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/logger/services/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/logger/services/console.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/logger/services/file.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/runtime/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/runtime/docker/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/runtime/docker/docker.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/runtime/env.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/services/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/utils/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/utils/caching.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/utils/http_client.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/utils/http_request.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/utils/http_status.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/utils/image.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/utils/mcp_client.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/utils/renderers.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/utils/resolvers.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/utils/shell.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/utils/ssh_client.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/utils/streamer.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/utils/streaming.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/utils/time.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/utils/workqueue.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/workflow/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/workflow/context.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/workflow/job/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/workflow/job/base.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/workflow/job/impl/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/workflow/job/impl/action.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/workflow/job/impl/delay.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/workflow/job/impl/if_.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/workflow/job/impl/random_router.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/workflow/job/impl/switch.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/workflow/job/job.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/workflow/schema.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/workflow/workflow.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/loader.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/action/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/action/action.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/action/impl/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/action/impl/common.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/action/impl/http_client.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/action/impl/http_server.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/action/impl/mcp_client.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/action/impl/model/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/action/impl/model/impl/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/action/impl/model/impl/common.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/action/impl/model/impl/summarization.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/action/impl/model/impl/text_classification.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/action/impl/model/impl/text_embedding.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/action/impl/model/impl/text_generation.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/action/impl/model/impl/translation.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/action/impl/model/model.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/action/impl/shell.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/action/impl/text_splitter.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/action/impl/workflow.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/component.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/impl/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/impl/common.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/impl/model/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/impl/model/impl/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/impl/model/impl/common.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/impl/model/impl/types.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/impl/model/model.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/impl/shell.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/impl/text_splitter.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/impl/types.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/impl/workflow.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/compose.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/controller/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/controller/controller.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/controller/impl/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/controller/impl/common.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/controller/impl/http_server.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/controller/impl/mcp_server.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/controller/impl/types.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/controller/webui/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/controller/webui/impl/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/controller/webui/impl/common.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/controller/webui/impl/dynamic.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/controller/webui/impl/gradio.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/controller/webui/impl/static.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/controller/webui/webui.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/gateway/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/gateway/gateway.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/gateway/impl/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/gateway/impl/common.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/gateway/impl/http_tunnel.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/gateway/impl/ssh_tunnel.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/gateway/impl/types.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/job/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/job/impl/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/job/impl/action.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/job/impl/common.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/job/impl/delay.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/job/impl/if_.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/job/impl/random_router.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/job/impl/switch.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/job/impl/types.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/job/job.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/listener/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/listener/impl/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/listener/impl/common.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/listener/impl/http_callback.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/listener/impl/types.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/listener/listener.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/logger/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/logger/impl/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/logger/impl/common.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/logger/impl/console.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/logger/impl/file.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/logger/impl/types.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/logger/logger.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/runtime/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/runtime/impl/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/runtime/impl/common.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/runtime/impl/docker.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/runtime/impl/native.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/runtime/impl/types.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/runtime/runtime.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/workflow.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/utils/__init__.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/utils/annotation.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/utils/enum.py +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/model_compose.egg-info/dependency_links.txt +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/model_compose.egg-info/entry_points.txt +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/model_compose.egg-info/requires.txt +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/src/model_compose.egg-info/top_level.txt +0 -0
- {model_compose-0.3.7 → model_compose-0.3.8}/tests/test_cli.py +0 -0
|
@@ -57,11 +57,11 @@ class ComponentService(AsyncService):
|
|
|
57
57
|
if self.config.max_concurrent_count > 0:
|
|
58
58
|
self.queue = WorkQueue(self.config.max_concurrent_count, self._run)
|
|
59
59
|
|
|
60
|
-
async def
|
|
61
|
-
await self.
|
|
60
|
+
async def setup(self) -> None:
|
|
61
|
+
await self._setup()
|
|
62
62
|
|
|
63
|
-
async def
|
|
64
|
-
await self.
|
|
63
|
+
async def teardown(self) -> None:
|
|
64
|
+
await self._teardown()
|
|
65
65
|
|
|
66
66
|
async def run(self, action_id: Union[str, None], run_id: str, input: Dict[str, Any]) -> Dict[str, Any]:
|
|
67
67
|
_, action = ActionResolver(self.config.actions).resolve(action_id)
|
|
@@ -72,10 +72,10 @@ class ComponentService(AsyncService):
|
|
|
72
72
|
|
|
73
73
|
return await self._run(action, context)
|
|
74
74
|
|
|
75
|
-
async def
|
|
75
|
+
async def _setup(self) -> None:
|
|
76
76
|
pass
|
|
77
77
|
|
|
78
|
-
async def
|
|
78
|
+
async def _teardown(self) -> None:
|
|
79
79
|
pass
|
|
80
80
|
|
|
81
81
|
async def _start(self) -> None:
|
{model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/component/services/http_server.py
RENAMED
|
@@ -10,7 +10,7 @@ from mindor.core.utils.shell import run_command_streaming
|
|
|
10
10
|
from ..base import ComponentService, ComponentType, ComponentGlobalConfigs, register_component
|
|
11
11
|
from ..context import ComponentActionContext
|
|
12
12
|
from datetime import datetime, timezone
|
|
13
|
-
import asyncio
|
|
13
|
+
import asyncio
|
|
14
14
|
|
|
15
15
|
class HttpServerCompletion(ABC):
|
|
16
16
|
def __init__(self, config: HttpServerCompletionConfig):
|
|
@@ -104,13 +104,17 @@ class HttpServerComponent(ComponentService):
|
|
|
104
104
|
|
|
105
105
|
self.client: Optional[HttpClient] = None
|
|
106
106
|
|
|
107
|
-
async def
|
|
107
|
+
async def _setup(self) -> None:
|
|
108
108
|
if self.config.commands.install:
|
|
109
|
-
|
|
109
|
+
for command in self.config.commands.install:
|
|
110
|
+
await run_command_streaming(command, self.config.working_dir, self.config.env)
|
|
110
111
|
|
|
111
|
-
async def _build(self) -> None:
|
|
112
112
|
if self.config.commands.build:
|
|
113
|
-
|
|
113
|
+
for command in self.config.commands.build:
|
|
114
|
+
await run_command_streaming(command, self.config.working_dir, self.config.env)
|
|
115
|
+
|
|
116
|
+
async def _teardown(self):
|
|
117
|
+
pass
|
|
114
118
|
|
|
115
119
|
async def _start(self) -> None:
|
|
116
120
|
base_url = f"http://localhost:{self.config.port}" + (self.config.base_path or "")
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
|
+
from mindor.dsl.schema.component import McpServerComponentConfig
|
|
3
|
+
from mindor.dsl.schema.action import ActionConfig, McpServerActionConfig
|
|
4
|
+
from mindor.core.utils.mcp_client import McpClient, ContentBlock, TextContent, ImageContent, AudioContent
|
|
5
|
+
from mindor.core.utils.shell import run_command_streaming
|
|
6
|
+
from ..base import ComponentService, ComponentType, ComponentGlobalConfigs, register_component
|
|
7
|
+
from ..context import ComponentActionContext
|
|
8
|
+
|
|
9
|
+
class McpServerAction:
|
|
10
|
+
def __init__(self, config: McpServerActionConfig):
|
|
11
|
+
self.config: McpServerActionConfig = config
|
|
12
|
+
|
|
13
|
+
async def run(self, context: ComponentActionContext, client: McpClient) -> Any:
|
|
14
|
+
tool = await context.render_variable(self.config.tool)
|
|
15
|
+
arguments = await context.render_variable(self.config.arguments)
|
|
16
|
+
|
|
17
|
+
response = [ await self._convert_output_value(content) for content in await client.call_tool(tool, arguments) ]
|
|
18
|
+
context.register_source("response", response)
|
|
19
|
+
|
|
20
|
+
return (await context.render_variable(self.config.output, ignore_files=True)) if self.config.output else response
|
|
21
|
+
|
|
22
|
+
async def _convert_output_value(self, content: ContentBlock) -> Any:
|
|
23
|
+
if isinstance(content, TextContent):
|
|
24
|
+
return content.text
|
|
25
|
+
|
|
26
|
+
if isinstance(content, (ImageContent, AudioContent)):
|
|
27
|
+
return content.data
|
|
28
|
+
|
|
29
|
+
return None
|
|
30
|
+
|
|
31
|
+
@register_component(ComponentType.MCP_SERVER)
|
|
32
|
+
class McpServerComponent(ComponentService):
|
|
33
|
+
def __init__(self, id: str, config: McpServerComponentConfig, global_configs: ComponentGlobalConfigs, daemon: bool):
|
|
34
|
+
super().__init__(id, config, global_configs, daemon)
|
|
35
|
+
|
|
36
|
+
self.client: Optional[McpClient] = None
|
|
37
|
+
|
|
38
|
+
async def _setup(self) -> None:
|
|
39
|
+
if self.config.commands.install:
|
|
40
|
+
for command in self.config.commands.install:
|
|
41
|
+
await run_command_streaming(command, self.config.working_dir, self.config.env)
|
|
42
|
+
|
|
43
|
+
if self.config.commands.build:
|
|
44
|
+
for command in self.config.commands.build:
|
|
45
|
+
await run_command_streaming(command, self.config.working_dir, self.config.env)
|
|
46
|
+
|
|
47
|
+
async def _teardown(self):
|
|
48
|
+
pass
|
|
49
|
+
|
|
50
|
+
async def _start(self) -> None:
|
|
51
|
+
base_url = f"http://localhost:{self.config.port}" + (self.config.base_path or "")
|
|
52
|
+
self.client = McpClient(base_url, self.config.headers)
|
|
53
|
+
await super()._start()
|
|
54
|
+
|
|
55
|
+
async def _stop(self) -> None:
|
|
56
|
+
await super()._stop()
|
|
57
|
+
await self.client.close()
|
|
58
|
+
self.client = None
|
|
59
|
+
|
|
60
|
+
async def _serve(self) -> None:
|
|
61
|
+
if self.config.commands.start:
|
|
62
|
+
await run_command_streaming(self.config.commands.start, self.config.working_dir, self.config.env, block=False)
|
|
63
|
+
|
|
64
|
+
async def _shutdown(self) -> None:
|
|
65
|
+
pass
|
|
66
|
+
|
|
67
|
+
async def _run(self, action: ActionConfig, context: ComponentActionContext) -> Any:
|
|
68
|
+
return await McpServerAction(action).run(context, self.client)
|
|
@@ -4,8 +4,7 @@ from mindor.dsl.schema.action import ActionConfig, ShellActionConfig
|
|
|
4
4
|
from mindor.core.utils.shell import run_command
|
|
5
5
|
from ..base import ComponentService, ComponentType, ComponentGlobalConfigs, register_component
|
|
6
6
|
from ..context import ComponentActionContext
|
|
7
|
-
|
|
8
|
-
import asyncio, os
|
|
7
|
+
import os
|
|
9
8
|
|
|
10
9
|
class ShellAction:
|
|
11
10
|
def __init__(self, config: ShellActionConfig, base_dir: Optional[str], env: Optional[Dict[str, str]]):
|
|
@@ -25,23 +24,12 @@ class ShellAction:
|
|
|
25
24
|
async def _run_command(self, command: List[str], working_dir: str, env: Dict[str, str], timeout: Optional[float]) -> Dict[str, Any]:
|
|
26
25
|
stdout, stderr, exit_code = await run_command(command, working_dir, env, timeout)
|
|
27
26
|
|
|
28
|
-
return {
|
|
29
|
-
"stdout": stdout.decode().strip(),
|
|
27
|
+
return {
|
|
28
|
+
"stdout": stdout.decode().strip(),
|
|
30
29
|
"stderr": stderr.decode().strip(),
|
|
31
30
|
"exit_code": exit_code
|
|
32
31
|
}
|
|
33
32
|
|
|
34
|
-
async def _kill_process(self, process: Process) -> bool:
|
|
35
|
-
if process.returncode is None:
|
|
36
|
-
process.kill()
|
|
37
|
-
try:
|
|
38
|
-
await process.wait()
|
|
39
|
-
except Exception as e:
|
|
40
|
-
pass
|
|
41
|
-
return True
|
|
42
|
-
else:
|
|
43
|
-
return False
|
|
44
|
-
|
|
45
33
|
async def _resolve_working_directory(self) -> str:
|
|
46
34
|
working_dir = self.config.working_dir
|
|
47
35
|
|
|
@@ -9,7 +9,7 @@ async def terminate_services(config: ComposeConfig, verbose: bool):
|
|
|
9
9
|
await ComposeManager(config, daemon=False).terminate_services(verbose)
|
|
10
10
|
|
|
11
11
|
async def start_services(config: ComposeConfig, verbose: bool):
|
|
12
|
-
await ComposeManager(config, daemon=
|
|
12
|
+
await ComposeManager(config, daemon=True).start_services(verbose)
|
|
13
13
|
|
|
14
14
|
async def stop_services(config: ComposeConfig, verbose: bool):
|
|
15
15
|
await ComposeManager(config, daemon=False).stop_services(verbose)
|
|
@@ -16,16 +16,16 @@ class ComposeManager:
|
|
|
16
16
|
)
|
|
17
17
|
|
|
18
18
|
async def launch_services(self, detach: bool, verbose: bool):
|
|
19
|
-
await self.controller.
|
|
19
|
+
await self.controller.launch_services(detach, verbose)
|
|
20
20
|
|
|
21
21
|
async def terminate_services(self, verbose: bool):
|
|
22
|
-
await self.controller.
|
|
22
|
+
await self.controller.terminate_services(verbose)
|
|
23
23
|
|
|
24
24
|
async def start_services(self, verbose: bool):
|
|
25
|
-
await self.controller.
|
|
25
|
+
await self.controller.start_services(verbose)
|
|
26
26
|
|
|
27
27
|
async def stop_services(self, verbose: bool):
|
|
28
|
-
await self.controller.
|
|
28
|
+
await self.controller.stop_services(verbose)
|
|
29
29
|
|
|
30
30
|
async def run_workflow(self, workflow_id: Optional[str], input: Dict[str, Any], output_path: Optional[str], verbose: bool) -> TaskState:
|
|
31
31
|
if not self.controller.started:
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
2
|
from enum import Enum
|
|
3
3
|
from dataclasses import dataclass
|
|
4
|
-
from pydantic import BaseModel
|
|
5
4
|
from mindor.dsl.schema.controller import ControllerConfig, ControllerType
|
|
6
5
|
from mindor.dsl.schema.component import ComponentConfig
|
|
7
6
|
from mindor.dsl.schema.listener import ListenerConfig
|
|
8
7
|
from mindor.dsl.schema.gateway import GatewayConfig
|
|
9
8
|
from mindor.dsl.schema.workflow import WorkflowConfig
|
|
10
|
-
from mindor.dsl.schema.runtime import RuntimeType
|
|
9
|
+
from mindor.dsl.schema.runtime import RuntimeType
|
|
11
10
|
from mindor.dsl.schema.logger import LoggerConfig, LoggerType, ConsoleLoggerConfig
|
|
12
11
|
from mindor.core.services import AsyncService
|
|
13
12
|
from mindor.core.component import ComponentService, ComponentGlobalConfigs, create_component
|
|
@@ -20,9 +19,11 @@ from mindor.core.workflow.schema import WorkflowSchema, create_workflow_schemas
|
|
|
20
19
|
from mindor.core.utils.workqueue import WorkQueue
|
|
21
20
|
from mindor.core.utils.caching import ExpiringDict
|
|
22
21
|
from .runtime.specs import ControllerRuntimeSpecs
|
|
22
|
+
from .runtime.native import NativeRuntimeLauncher
|
|
23
23
|
from .runtime.docker import DockerRuntimeLauncher
|
|
24
24
|
from threading import Lock
|
|
25
|
-
import
|
|
25
|
+
from pathlib import Path
|
|
26
|
+
import asyncio, ulid, os
|
|
26
27
|
|
|
27
28
|
class TaskStatus(str, Enum):
|
|
28
29
|
PENDING = "pending"
|
|
@@ -64,10 +65,15 @@ class ControllerService(AsyncService):
|
|
|
64
65
|
if self.config.max_concurrent_count > 0:
|
|
65
66
|
self.task_queue = WorkQueue(self.config.max_concurrent_count, self._run_workflow)
|
|
66
67
|
|
|
67
|
-
async def
|
|
68
|
+
async def launch_services(self, detach: bool, verbose: bool) -> None:
|
|
68
69
|
if self.config.runtime.type == RuntimeType.NATIVE:
|
|
69
70
|
if detach:
|
|
70
|
-
|
|
71
|
+
await self._start_loggers()
|
|
72
|
+
await NativeRuntimeLauncher().launch_detached()
|
|
73
|
+
await self._stop_loggers()
|
|
74
|
+
return
|
|
75
|
+
|
|
76
|
+
await self._setup_components()
|
|
71
77
|
await self.start()
|
|
72
78
|
await self.wait_until_stopped()
|
|
73
79
|
return
|
|
@@ -75,16 +81,46 @@ class ControllerService(AsyncService):
|
|
|
75
81
|
if self.config.runtime.type == RuntimeType.DOCKER:
|
|
76
82
|
await self._start_loggers()
|
|
77
83
|
await DockerRuntimeLauncher(self.config, verbose).launch(self._get_runtime_specs(), detach)
|
|
84
|
+
await self._stop_loggers()
|
|
78
85
|
return
|
|
79
86
|
|
|
80
|
-
async def
|
|
87
|
+
async def terminate_services(self, verbose: bool) -> None:
|
|
81
88
|
if self.config.runtime.type == RuntimeType.NATIVE:
|
|
82
|
-
await self.
|
|
89
|
+
await self._start_loggers()
|
|
90
|
+
await NativeRuntimeLauncher().stop()
|
|
91
|
+
await self._teardown_components()
|
|
92
|
+
await self._stop_loggers()
|
|
83
93
|
return
|
|
84
|
-
|
|
94
|
+
|
|
85
95
|
if self.config.runtime.type == RuntimeType.DOCKER:
|
|
86
96
|
await self._start_loggers()
|
|
87
97
|
await DockerRuntimeLauncher(self.config, verbose).terminate()
|
|
98
|
+
await self._stop_loggers()
|
|
99
|
+
return
|
|
100
|
+
|
|
101
|
+
async def start_services(self, verbose: bool) -> None:
|
|
102
|
+
if self.config.runtime.type == RuntimeType.NATIVE:
|
|
103
|
+
await self.start()
|
|
104
|
+
await self.wait_until_stopped()
|
|
105
|
+
return
|
|
106
|
+
|
|
107
|
+
if self.config.runtime.type == RuntimeType.DOCKER:
|
|
108
|
+
await self._start_loggers()
|
|
109
|
+
await DockerRuntimeLauncher(self.config, verbose).start()
|
|
110
|
+
await self._stop_loggers()
|
|
111
|
+
return
|
|
112
|
+
|
|
113
|
+
async def stop_services(self, verbose: bool) -> None:
|
|
114
|
+
if self.config.runtime.type == RuntimeType.NATIVE:
|
|
115
|
+
await self._start_loggers()
|
|
116
|
+
await NativeRuntimeLauncher().stop()
|
|
117
|
+
await self._stop_loggers()
|
|
118
|
+
return
|
|
119
|
+
|
|
120
|
+
if self.config.runtime.type == RuntimeType.DOCKER:
|
|
121
|
+
await self._start_loggers()
|
|
122
|
+
await DockerRuntimeLauncher(self.config, verbose).stop()
|
|
123
|
+
await self._stop_loggers()
|
|
88
124
|
return
|
|
89
125
|
|
|
90
126
|
async def run_workflow(self, workflow_id: Optional[str], input: Dict[str, Any], wait_for_completion: bool = True) -> TaskState:
|
|
@@ -111,8 +147,9 @@ class ControllerService(AsyncService):
|
|
|
111
147
|
if self.task_queue:
|
|
112
148
|
await self.task_queue.start()
|
|
113
149
|
|
|
150
|
+
await self._start_loggers()
|
|
151
|
+
|
|
114
152
|
if self.daemon:
|
|
115
|
-
await self._start_loggers()
|
|
116
153
|
await self._start_gateways()
|
|
117
154
|
await self._start_listeners()
|
|
118
155
|
await self._start_components()
|
|
@@ -120,6 +157,8 @@ class ControllerService(AsyncService):
|
|
|
120
157
|
if self.config.webui:
|
|
121
158
|
await self._start_webui()
|
|
122
159
|
|
|
160
|
+
asyncio.create_task(self._watch_stop_request())
|
|
161
|
+
|
|
123
162
|
await super()._start()
|
|
124
163
|
|
|
125
164
|
async def _stop(self) -> None:
|
|
@@ -130,13 +169,26 @@ class ControllerService(AsyncService):
|
|
|
130
169
|
await self._stop_components()
|
|
131
170
|
await self._stop_listeners()
|
|
132
171
|
await self._stop_gateways()
|
|
133
|
-
await self._stop_loggers()
|
|
134
172
|
|
|
135
173
|
if self.config.webui:
|
|
136
174
|
await self._stop_webui()
|
|
137
175
|
|
|
138
176
|
await super()._stop()
|
|
139
177
|
|
|
178
|
+
async def _on_stop(self) -> None:
|
|
179
|
+
await self._stop_loggers()
|
|
180
|
+
|
|
181
|
+
async def _watch_stop_request(self, interval: float = 1.0) -> None:
|
|
182
|
+
stop_file = Path.cwd() / ".stop"
|
|
183
|
+
|
|
184
|
+
while self.started:
|
|
185
|
+
if stop_file.exists():
|
|
186
|
+
await self.stop()
|
|
187
|
+
break
|
|
188
|
+
await asyncio.sleep(interval)
|
|
189
|
+
|
|
190
|
+
os.unlink(stop_file)
|
|
191
|
+
|
|
140
192
|
async def _start_listeners(self) -> None:
|
|
141
193
|
await asyncio.gather(*[ listener.start() for listener in self._create_listeners() ])
|
|
142
194
|
|
|
@@ -149,6 +201,12 @@ class ControllerService(AsyncService):
|
|
|
149
201
|
async def _stop_gateways(self) -> None:
|
|
150
202
|
await asyncio.gather(*[ gateway.stop() for gateway in self._create_gateways() ])
|
|
151
203
|
|
|
204
|
+
async def _setup_components(self) -> None:
|
|
205
|
+
await asyncio.gather(*[ component.setup() for component in self._create_components() ])
|
|
206
|
+
|
|
207
|
+
async def _teardown_components(self) -> None:
|
|
208
|
+
await asyncio.gather(*[ component.teardown() for component in self._create_components() ])
|
|
209
|
+
|
|
152
210
|
async def _start_components(self) -> None:
|
|
153
211
|
await asyncio.gather(*[ component.start() for component in self._create_components() ])
|
|
154
212
|
|
|
@@ -200,7 +258,7 @@ class ControllerService(AsyncService):
|
|
|
200
258
|
state = TaskState(task_id=task_id, status=TaskStatus.PROCESSING)
|
|
201
259
|
with self.task_states_lock:
|
|
202
260
|
self.task_states.set(task_id, state)
|
|
203
|
-
|
|
261
|
+
|
|
204
262
|
try:
|
|
205
263
|
workflow = self._create_workflow(workflow_id)
|
|
206
264
|
output = await workflow.run(task_id, input)
|
{model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/core/controller/runtime/docker/docker.py
RENAMED
|
@@ -14,7 +14,7 @@ class DockerRuntimeLauncher:
|
|
|
14
14
|
|
|
15
15
|
self._configure_runtime_config()
|
|
16
16
|
|
|
17
|
-
def _configure_runtime_config(self):
|
|
17
|
+
def _configure_runtime_config(self) -> None:
|
|
18
18
|
if not self.config.runtime.image:
|
|
19
19
|
if not self.config.runtime.build:
|
|
20
20
|
self.config.runtime.build = DockerBuildConfig(context=".docker", dockerfile="Dockerfile")
|
|
@@ -26,7 +26,7 @@ class DockerRuntimeLauncher:
|
|
|
26
26
|
if not self.config.runtime.ports:
|
|
27
27
|
self.config.runtime.ports = [ port for port in [ self.config.port, getattr(self.config.webui, "port", None) ] if port ]
|
|
28
28
|
|
|
29
|
-
async def launch(self, specs: ControllerRuntimeSpecs, detach: bool):
|
|
29
|
+
async def launch(self, specs: ControllerRuntimeSpecs, detach: bool) -> None:
|
|
30
30
|
docker = DockerRuntimeManager(self.config.runtime, self.verbose)
|
|
31
31
|
|
|
32
32
|
await self._prepare_docker_context(specs)
|
|
@@ -58,7 +58,7 @@ class DockerRuntimeLauncher:
|
|
|
58
58
|
logging.info("Starting Docker container (%s mode)...", "detached" if detach else "foreground")
|
|
59
59
|
await docker.start_container(detach)
|
|
60
60
|
|
|
61
|
-
async def terminate(self):
|
|
61
|
+
async def terminate(self) -> None:
|
|
62
62
|
docker = DockerRuntimeManager(self.config.runtime, self.verbose)
|
|
63
63
|
|
|
64
64
|
if await docker.exists_container():
|
|
@@ -67,6 +67,12 @@ class DockerRuntimeLauncher:
|
|
|
67
67
|
if await docker.exists_image():
|
|
68
68
|
await docker.remove_image()
|
|
69
69
|
|
|
70
|
+
async def start(self) -> None:
|
|
71
|
+
pass
|
|
72
|
+
|
|
73
|
+
async def stop(self) -> None:
|
|
74
|
+
pass
|
|
75
|
+
|
|
70
76
|
async def _prepare_docker_context(self, specs: ControllerRuntimeSpecs) -> None:
|
|
71
77
|
# Prepare context directory
|
|
72
78
|
context_dir = Path.cwd() / ".docker"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .native import *
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from mindor.core.logger import logging
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
import sys, os, subprocess
|
|
4
|
+
|
|
5
|
+
class NativeRuntimeLauncher:
|
|
6
|
+
async def launch_detached(self) -> None:
|
|
7
|
+
command = [ sys.executable ] + [ arg for arg in sys.argv if arg not in ( "--detach", "-d" ) ]
|
|
8
|
+
env = os.environ.copy()
|
|
9
|
+
|
|
10
|
+
logging.debug(f"Detaching and spawning: %s", " ".join(command))
|
|
11
|
+
|
|
12
|
+
subprocess.Popen(
|
|
13
|
+
command,
|
|
14
|
+
stdout=subprocess.DEVNULL,
|
|
15
|
+
stderr=subprocess.DEVNULL,
|
|
16
|
+
stdin=subprocess.DEVNULL,
|
|
17
|
+
env=env,
|
|
18
|
+
close_fds=True,
|
|
19
|
+
start_new_session=True,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
async def stop(self) -> None:
|
|
23
|
+
stop_file = Path.cwd() / ".stop"
|
|
24
|
+
stop_file.touch()
|
|
@@ -42,6 +42,8 @@ class AsyncService(ABC):
|
|
|
42
42
|
if self.daemon_task:
|
|
43
43
|
await self.daemon_task
|
|
44
44
|
|
|
45
|
+
await self._on_stop()
|
|
46
|
+
|
|
45
47
|
def run_in_thread(self, runner: Callable[[], Awaitable[Any]]) -> asyncio.Future:
|
|
46
48
|
loop = asyncio.get_running_loop()
|
|
47
49
|
future: asyncio.Future = loop.create_future()
|
|
@@ -79,6 +81,9 @@ class AsyncService(ABC):
|
|
|
79
81
|
|
|
80
82
|
self.started = False
|
|
81
83
|
|
|
84
|
+
async def _on_stop(self) -> None:
|
|
85
|
+
pass
|
|
86
|
+
|
|
82
87
|
@abstractmethod
|
|
83
88
|
async def _serve(self) -> None:
|
|
84
89
|
pass
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
|
+
from pydantic import BaseModel, Field
|
|
3
|
+
from pydantic import model_validator
|
|
4
|
+
from .common import CommonActionConfig
|
|
5
|
+
|
|
6
|
+
class McpServerActionConfig(CommonActionConfig):
|
|
7
|
+
tool: str = Field(default="__default__", description="Name of the tool to invoke.")
|
|
8
|
+
arguments: Dict[str, Any] = Field(default_factory=dict, description="Arguments to pass to the tool.")
|
|
9
|
+
headers: Dict[str, str] = Field(default_factory=dict, description="Optional HTTP headers to include in the tool call.")
|
{model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/impl/http_client.py
RENAMED
|
@@ -8,7 +8,7 @@ class HttpClientComponentConfig(CommonComponentConfig):
|
|
|
8
8
|
type: Literal[ComponentType.HTTP_CLIENT]
|
|
9
9
|
base_url: Optional[str] = Field(default=None, description="")
|
|
10
10
|
headers: Dict[str, Any] = Field(default_factory=dict, description="")
|
|
11
|
-
actions: Dict[str, HttpClientActionConfig] = Field(default_factory=dict
|
|
11
|
+
actions: Dict[str, HttpClientActionConfig] = Field(default_factory=dict)
|
|
12
12
|
|
|
13
13
|
@model_validator(mode="before")
|
|
14
14
|
def inflate_single_action(cls, values: Dict[str, Any]):
|
{model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/impl/http_server.py
RENAMED
|
@@ -5,19 +5,27 @@ from mindor.dsl.schema.action import HttpServerActionConfig
|
|
|
5
5
|
from .common import ComponentType, CommonComponentConfig
|
|
6
6
|
|
|
7
7
|
class HttpServerCommands(BaseModel):
|
|
8
|
-
install: Optional[List[str]] = Field(default=None, description="")
|
|
9
|
-
build: Optional[List[str]] = Field(default=None, description="")
|
|
10
|
-
start: Optional[List[str]] = Field(default=None, description="")
|
|
8
|
+
install: Optional[List[List[str]]] = Field(default=None, description="One or more commands to install dependencies.")
|
|
9
|
+
build: Optional[List[List[str]]] = Field(default=None, description="One or more commands to build the server.")
|
|
10
|
+
start: Optional[List[str]] = Field(default=None, description="Command to start the server.")
|
|
11
|
+
|
|
12
|
+
@model_validator(mode="before")
|
|
13
|
+
def normalize_commands(cls, values):
|
|
14
|
+
for key in [ "install", "build" ]:
|
|
15
|
+
command = values.get(key)
|
|
16
|
+
if command and isinstance(command, list) and all(isinstance(token, str) for token in command):
|
|
17
|
+
values[key] = [ command ]
|
|
18
|
+
return values
|
|
11
19
|
|
|
12
20
|
class HttpServerComponentConfig(CommonComponentConfig):
|
|
13
21
|
type: Literal[ComponentType.HTTP_SERVER]
|
|
14
|
-
commands: HttpServerCommands = Field(..., description="")
|
|
22
|
+
commands: HttpServerCommands = Field(..., description="Shell commands used to install, build, and start the server.")
|
|
15
23
|
working_dir: Optional[str] = Field(default=None, description="Working directory for the commands.")
|
|
16
24
|
env: Dict[str, str] = Field(default_factory=dict, description="Environment variables to set when executing the commands.")
|
|
17
|
-
port: int = Field(default=8000, ge=1, le=65535, description="")
|
|
18
|
-
base_path: Optional[str] = Field(default=None, description="")
|
|
19
|
-
headers: Dict[str, Any] = Field(default_factory=dict, description="")
|
|
20
|
-
actions: Dict[str, HttpServerActionConfig] = Field(default_factory=dict
|
|
25
|
+
port: int = Field(default=8000, ge=1, le=65535, description="Port on which the server will listen.")
|
|
26
|
+
base_path: Optional[str] = Field(default=None, description="Base path to prefix all HTTP routes exposed by this component.")
|
|
27
|
+
headers: Dict[str, Any] = Field(default_factory=dict, description="Headers to be included in all outgoing HTTP requests.")
|
|
28
|
+
actions: Dict[str, HttpServerActionConfig] = Field(default_factory=dict)
|
|
21
29
|
|
|
22
30
|
@model_validator(mode="before")
|
|
23
31
|
def inflate_single_command(cls, values: Dict[str, Any]):
|
{model_compose-0.3.7 → model_compose-0.3.8}/src/mindor/dsl/schema/component/impl/mcp_client.py
RENAMED
|
@@ -8,7 +8,7 @@ class McpClientComponentConfig(CommonComponentConfig):
|
|
|
8
8
|
type: Literal[ComponentType.MCP_CLIENT]
|
|
9
9
|
url: str = Field(..., description="URL of the MCP server to invoke tools.")
|
|
10
10
|
headers: Dict[str, Any] = Field(default_factory=dict, description="")
|
|
11
|
-
actions: Dict[str, McpClientActionConfig] = Field(default_factory=dict
|
|
11
|
+
actions: Dict[str, McpClientActionConfig] = Field(default_factory=dict)
|
|
12
12
|
|
|
13
13
|
@model_validator(mode="before")
|
|
14
14
|
def inflate_single_action(cls, values: Dict[str, Any]):
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
|
+
from pydantic import BaseModel, Field
|
|
3
|
+
from pydantic import model_validator
|
|
4
|
+
from mindor.dsl.schema.action import McpServerActionConfig
|
|
5
|
+
from .common import ComponentType, CommonComponentConfig
|
|
6
|
+
|
|
7
|
+
class McpServerCommands(BaseModel):
|
|
8
|
+
install: Optional[List[List[str]]] = Field(default=None, description="One or more commands to install dependencies.")
|
|
9
|
+
build: Optional[List[List[str]]] = Field(default=None, description="One or more commands to build the server.")
|
|
10
|
+
start: Optional[List[str]] = Field(default=None, description="Command to start the server.")
|
|
11
|
+
|
|
12
|
+
@model_validator(mode="before")
|
|
13
|
+
def normalize_commands(cls, values):
|
|
14
|
+
for key in [ "install", "build" ]:
|
|
15
|
+
command = values.get(key)
|
|
16
|
+
if command and isinstance(command, list) and all(isinstance(token, str) for token in command):
|
|
17
|
+
values[key] = [ command ]
|
|
18
|
+
return values
|
|
19
|
+
|
|
20
|
+
class McpServerComponentConfig(CommonComponentConfig):
|
|
21
|
+
type: Literal[ComponentType.MCP_SERVER]
|
|
22
|
+
commands: McpServerCommands = Field(..., description="")
|
|
23
|
+
working_dir: Optional[str] = Field(default=None, description="Working directory for the commands.")
|
|
24
|
+
env: Dict[str, str] = Field(default_factory=dict, description="Environment variables to set when executing the commands.")
|
|
25
|
+
port: int = Field(default=8000, ge=1, le=65535, description="")
|
|
26
|
+
base_path: Optional[str] = Field(default=None, description="")
|
|
27
|
+
actions: Dict[str, McpServerActionConfig] = Field(default_factory=dict)
|
|
@@ -6,4 +6,4 @@ from .common import CommonModelComponentConfig, ModelTaskType
|
|
|
6
6
|
|
|
7
7
|
class SummarizationModelComponentConfig(CommonModelComponentConfig):
|
|
8
8
|
task: Literal[ModelTaskType.SUMMARIZATION]
|
|
9
|
-
actions: Dict[str, SummarizationModelActionConfig] = Field(default_factory=dict
|
|
9
|
+
actions: Dict[str, SummarizationModelActionConfig] = Field(default_factory=dict)
|
|
@@ -6,4 +6,4 @@ from .common import ClassificationModelComponentConfig, ModelTaskType
|
|
|
6
6
|
|
|
7
7
|
class TextClassificationModelComponentConfig(ClassificationModelComponentConfig):
|
|
8
8
|
task: Literal[ModelTaskType.TEXT_CLASSIFICATION]
|
|
9
|
-
actions: Dict[str, TextClassificationModelActionConfig] = Field(default_factory=dict
|
|
9
|
+
actions: Dict[str, TextClassificationModelActionConfig] = Field(default_factory=dict)
|
|
@@ -6,4 +6,4 @@ from .common import CommonModelComponentConfig, ModelTaskType
|
|
|
6
6
|
|
|
7
7
|
class TextEmbeddingModelComponentConfig(CommonModelComponentConfig):
|
|
8
8
|
task: Literal[ModelTaskType.TEXT_EMBEDDING]
|
|
9
|
-
actions: Dict[str, TextEmbeddingModelActionConfig] = Field(default_factory=dict
|
|
9
|
+
actions: Dict[str, TextEmbeddingModelActionConfig] = Field(default_factory=dict)
|
|
@@ -6,4 +6,4 @@ from .common import CommonModelComponentConfig, ModelTaskType
|
|
|
6
6
|
|
|
7
7
|
class TextGenerationModelComponentConfig(CommonModelComponentConfig):
|
|
8
8
|
task: Literal[ModelTaskType.TEXT_GENERATION]
|
|
9
|
-
actions: Dict[str, TextGenerationModelActionConfig] = Field(default_factory=dict
|
|
9
|
+
actions: Dict[str, TextGenerationModelActionConfig] = Field(default_factory=dict)
|
|
@@ -6,4 +6,4 @@ from .common import CommonModelComponentConfig, ModelTaskType
|
|
|
6
6
|
|
|
7
7
|
class TranslationModelComponentConfig(CommonModelComponentConfig):
|
|
8
8
|
task: Literal[ModelTaskType.TRANSLATION]
|
|
9
|
-
actions: Dict[str, TranslationModelActionConfig] = Field(default_factory=dict
|
|
9
|
+
actions: Dict[str, TranslationModelActionConfig] = Field(default_factory=dict)
|
|
@@ -42,6 +42,8 @@ src/mindor/core/controller/runtime/specs.py
|
|
|
42
42
|
src/mindor/core/controller/runtime/docker/__init__.py
|
|
43
43
|
src/mindor/core/controller/runtime/docker/docker.py
|
|
44
44
|
src/mindor/core/controller/runtime/docker/context/Dockerfile
|
|
45
|
+
src/mindor/core/controller/runtime/native/__init__.py
|
|
46
|
+
src/mindor/core/controller/runtime/native/native.py
|
|
45
47
|
src/mindor/core/controller/services/__init__.py
|
|
46
48
|
src/mindor/core/controller/services/http_server.py
|
|
47
49
|
src/mindor/core/controller/services/mcp_server.py
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
|
-
from mindor.dsl.schema.component import McpServerComponentConfig
|
|
3
|
-
from mindor.dsl.schema.action import ActionConfig, McpServerActionConfig
|
|
4
|
-
from ..base import ComponentService, ComponentType, ComponentGlobalConfigs, register_component
|
|
5
|
-
from ..context import ComponentActionContext
|
|
6
|
-
|
|
7
|
-
class McpServerAction:
|
|
8
|
-
def __init__(self, config: McpServerActionConfig):
|
|
9
|
-
self.config: McpServerActionConfig = config
|
|
10
|
-
|
|
11
|
-
async def run(self, context: ComponentActionContext) -> Any:
|
|
12
|
-
pass
|
|
13
|
-
|
|
14
|
-
@register_component(ComponentType.MCP_SERVER)
|
|
15
|
-
class McpServerComponent(ComponentService):
|
|
16
|
-
def __init__(self, id: str, config: McpServerComponentConfig, global_configs: ComponentGlobalConfigs, daemon: bool):
|
|
17
|
-
super().__init__(id, config, global_configs, daemon)
|
|
18
|
-
|
|
19
|
-
async def _serve(self) -> None:
|
|
20
|
-
pass
|
|
21
|
-
|
|
22
|
-
async def _shutdown(self) -> None:
|
|
23
|
-
pass
|
|
24
|
-
|
|
25
|
-
async def _run(self, action: ActionConfig, context: ComponentActionContext) -> Any:
|
|
26
|
-
return await McpServerAction(action).run(context)
|
|
27
|
-
|