swarmauri-base 0.11.0.dev5__tar.gz → 0.11.0.dev7__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.
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/PKG-INFO +7 -3
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/README.md +3 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/pyproject.toml +4 -4
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/ComponentBase.py +1 -0
- swarmauri_base-0.11.0.dev7/swarmauri_base/agents/AgentCompactionMixin.py +89 -0
- swarmauri_base-0.11.0.dev7/swarmauri_base/conversations/ConversationCompactionMixin.py +126 -0
- swarmauri_base-0.11.0.dev7/swarmauri_base/git_filters/config.py +27 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/middlewares/MiddlewareBase.py +3 -10
- swarmauri_base-0.11.0.dev7/swarmauri_base/processes/ContainerProcessBackendBase.py +161 -0
- swarmauri_base-0.11.0.dev7/swarmauri_base/processes/__init__.py +3 -0
- swarmauri_base-0.11.0.dev7/swarmauri_base/processes/_subprocess.py +153 -0
- swarmauri_base-0.11.0.dev7/swarmauri_base/processes/collect_process.py +42 -0
- swarmauri_base-0.11.0.dev7/swarmauri_base/run_stores/RunStoreBase.py +51 -0
- swarmauri_base-0.11.0.dev7/swarmauri_base/run_stores/__init__.py +3 -0
- swarmauri_base-0.11.0.dev7/swarmauri_base/skills/SkillCatalog.py +41 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/tools/ParameterBase.py +1 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/tools/ToolExecutorBase.py +20 -10
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/LICENSE +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/DynamicBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/LoggerMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/ObserveBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/ServiceMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/TomlMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/YamlMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/agents/AgentBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/agents/AgentConversationMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/agents/AgentRetrieveMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/agents/AgentSystemContextMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/agents/AgentToolMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/agents/AgentVectorStoreMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/agents/RealtimeAgentBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/agents/RealtimeInputAdapterBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/agents/RealtimeOutputAdapterBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/agents/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/auth_idp/OAuth20AppClientBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/auth_idp/OAuth20LoginBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/auth_idp/OAuth21AppClientBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/auth_idp/OAuth21LoginBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/auth_idp/OIDC10AppClientBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/auth_idp/OIDC10LoginBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/auth_idp/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/auth_idp/http.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/auth_idp/utils.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/billing/BalanceTransfersMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/billing/BillingProviderBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/billing/CustomersMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/billing/HostedCheckoutMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/billing/InvoicingMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/billing/MarketplaceMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/billing/OnlinePaymentsMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/billing/PaymentMethodsMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/billing/PayoutsMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/billing/ProductsPricesMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/billing/PromotionsMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/billing/RefundsMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/billing/ReportsMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/billing/RiskMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/billing/SubscriptionsMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/billing/WebhooksMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/billing/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/billing/mixins.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/billing/refs.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/billing/specs.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/billing/utils.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/certs/CertServiceBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/certs/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/chains/ChainBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/chains/ChainContextBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/chains/ChainStepBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/chains/PromptContextChainBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/chains/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/chunkers/ChunkerBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/chunkers/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/cipher_suites/CipherSuiteBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/cipher_suites/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/conversations/ConversationBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/conversations/ConversationSystemContextMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/conversations/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/crypto/CryptoBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/crypto/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/dataconnectors/DataConnectorBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/dataconnectors/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/distances/DistanceBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/distances/VisionDistanceBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/distances/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/document_stores/DocumentStoreBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/document_stores/DocumentStoreRetrieveBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/document_stores/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/documents/DocumentBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/documents/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/embeddings/EmbeddingBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/embeddings/VisionEmbeddingBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/embeddings/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/ensembles/EnsembleBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/ensembles/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/evaluator_pools/EvaluatorPoolBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/evaluator_pools/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/evaluator_results/EvalResultBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/evaluator_results/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/evaluators/EvaluatorBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/evaluators/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/factories/FactoryBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/factories/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/git_filters/GitFilterBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/git_filters/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/glogging.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/image_gens/ImageGenBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/image_gens/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/inner_products/InnerProductBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/inner_products/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/key_providers/KeyProviderBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/key_providers/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/key_providers/loaders.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/LiveCapabilitiesBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/LiveConfigBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/LiveCorrelation.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/LiveEventBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/LiveInputBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/LiveModelBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/LiveSessionBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/LiveSessionRuntime.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/LiveSessionState.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/SyncLiveSessionBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/events/AudioDeltaEvent.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/events/InputTranscriptDeltaEvent.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/events/InterruptionEvent.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/events/OutputTranscriptDeltaEvent.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/events/SessionErrorEvent.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/events/SessionLifecycleEvent.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/events/SessionResumptionEvent.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/events/TextDeltaEvent.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/events/ToolCallEvent.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/events/ToolCancellationEvent.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/events/TurnCompleteEvent.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/events/UsageEvent.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/events/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/inputs/AudioInput.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/inputs/CommitTurnInput.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/inputs/ImageInput.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/inputs/InterruptInput.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/inputs/TextInput.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/inputs/ToolResultInput.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/inputs/VideoInput.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/live_models/inputs/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/llms/LLMBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/llms/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/logger_formatters/FormatterBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/logger_formatters/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/logger_handlers/HandlerBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/logger_handlers/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/loggers/LoggerBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/loggers/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/matrices/MatrixBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/matrices/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/measurements/MeasurementAggregateMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/measurements/MeasurementBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/measurements/MeasurementCalculateMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/measurements/MeasurementThresholdMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/measurements/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/messages/MessageBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/messages/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/metrics/MetricBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/metrics/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/middlewares/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/model_providers/ModelCatalogBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/model_providers/ModelProviderBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/model_providers/ProviderAuthBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/model_providers/ProviderConnectionConfig.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/model_providers/ProviderConnectionConfigBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/model_providers/ProviderEndpointBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/model_providers/ProviderErrorMapperBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/model_providers/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/models/ModelBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/models/ModelCapabilitiesBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/models/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/mre_crypto/MreCryptoBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/mre_crypto/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/norms/NormBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/norms/UseInnerProductMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/norms/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/ocrs/OCRBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/ocrs/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/parsers/ParserBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/parsers/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/pipelines/PipelineBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/pipelines/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/pop/PopSignerMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/pop/PopSigningBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/pop/PopVerifierMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/pop/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/pop/binding.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/pop/util.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/programs/ProgramBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/programs/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/prompt_templates/PromptTemplateBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/prompt_templates/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/prompts/PromptBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/prompts/PromptGeneratorBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/prompts/PromptMatrixBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/prompts/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/pseudometrics/PseudometricBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/pseudometrics/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/publishers/PublishBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/publishers/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/rate_limits/RateLimitBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/rate_limits/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/retrievers/RetrieverBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/retrievers/RetrieverMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/retrievers/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/schema_converters/SchemaConverterBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/schema_converters/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/secrets/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/seminorms/SeminormBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/seminorms/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/service_registries/ServiceRegistryBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/service_registries/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/signing/SigningBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/signing/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/similarities/SimilarityBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/similarities/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/skills/FileSystemSkillMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/skills/LocalSkillMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/skills/SkillBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/skills/SkillLoaderBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/skills/SkillMetadata.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/skills/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/state/StateBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/state/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/storage/StorageAdapterBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/storage/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/stt/STTBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/stt/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/swarms/SwarmBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/swarms/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/task_mgmt_strategies/TaskMgmtStrategyBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/task_mgmt_strategies/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/tensors/TensorBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/tensors/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/tokens/TokenServiceBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/tokens/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/tool_llms/ToolLLMBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/tool_llms/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/toolkits/ToolkitBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/toolkits/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/tools/ToolBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/tools/ToolExecutionError.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/tools/ToolExecutionPolicy.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/tools/ToolExecutionRequest.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/tools/ToolExecutionResult.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/tools/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/transports/TransportBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/transports/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/transports/appserver_mixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/transports/bidirectional/BidirectionalStreamClientBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/transports/bidirectional/BidirectionalStreamConnectionBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/transports/bidirectional/BidirectionalStreamState.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/transports/bidirectional/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/transports/http/AsyncHttpStreamResponseBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/transports/http/HttpClientBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/transports/http/HttpResponseBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/transports/http/HttpStreamResponseBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/transports/http/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/transports/http_client_mixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/transports/http_server_mixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/transports/mixins.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/transports/multiplex_mixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/transports/peer_mixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/transports/runnable_mixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/transports/websocket/WebSocketClientBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/transports/websocket/WebSocketConnectionBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/transports/websocket/WebSocketMultiplexConnectionBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/transports/websocket/WebSocketState.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/transports/websocket/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/tts/TTSBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/tts/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/utils/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/utils/allowed_models.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/vector_stores/VectorStoreBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/vector_stores/VectorStoreCloudMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/vector_stores/VectorStoreComparator.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/vector_stores/VectorStorePersistentMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/vector_stores/VectorStoreRetrieveMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/vector_stores/VectorStoreSaveLoadMixin.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/vector_stores/VisionVectorStoreBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/vector_stores/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/vectors/VectorBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/vectors/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/video_lipsync/LipSyncBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/video_lipsync/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/vlms/VLMBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/vlms/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/xmp/EmbedXmpBase.py +0 -0
- {swarmauri_base-0.11.0.dev5 → swarmauri_base-0.11.0.dev7}/swarmauri_base/xmp/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: swarmauri_base
|
|
3
|
-
Version: 0.11.0.
|
|
3
|
+
Version: 0.11.0.dev7
|
|
4
4
|
Summary: Reusable Swarmauri base classes, mixins, and dynamic Pydantic component models for composable intelligence infrastructure.
|
|
5
5
|
License-Expression: Apache-2.0
|
|
6
6
|
License-File: LICENSE
|
|
@@ -27,8 +27,9 @@ Classifier: Topic :: Text Processing :: Markup
|
|
|
27
27
|
Requires-Dist: numpy (>=1.26.4)
|
|
28
28
|
Requires-Dist: pydantic (>=2.0)
|
|
29
29
|
Requires-Dist: pyyaml (>=6.0.2)
|
|
30
|
-
Requires-Dist:
|
|
31
|
-
Requires-Dist:
|
|
30
|
+
Requires-Dist: starlette
|
|
31
|
+
Requires-Dist: swarmauri_core (>=0.11.0.dev7,<0.12)
|
|
32
|
+
Requires-Dist: swarmauri_typing
|
|
32
33
|
Requires-Dist: toml (>=0.10.2)
|
|
33
34
|
Requires-Dist: tomli (>=2.0) ; python_version < "3.11"
|
|
34
35
|
Description-Content-Type: text/markdown
|
|
@@ -215,5 +216,8 @@ Apache-2.0
|
|
|
215
216
|
|
|
216
217
|
When adding or changing a base class, keep it aligned with the corresponding `swarmauri_core` interface, preserve direct plugin instantiation patterns, update exports and tests, and follow the [Swarmauri SDK contribution guide](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md).
|
|
217
218
|
|
|
219
|
+
## Run storage
|
|
218
220
|
|
|
221
|
+
`swarmauri_base.run_stores.RunStoreBase` implements shared checkpoint revision
|
|
222
|
+
rules. A backend supplies an insert, a read, and an atomic compare-and-swap.
|
|
219
223
|
|
|
@@ -180,4 +180,7 @@ Apache-2.0
|
|
|
180
180
|
|
|
181
181
|
When adding or changing a base class, keep it aligned with the corresponding `swarmauri_core` interface, preserve direct plugin instantiation patterns, update exports and tests, and follow the [Swarmauri SDK contribution guide](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md).
|
|
182
182
|
|
|
183
|
+
## Run storage
|
|
183
184
|
|
|
185
|
+
`swarmauri_base.run_stores.RunStoreBase` implements shared checkpoint revision
|
|
186
|
+
rules. A backend supplies an insert, a read, and an atomic compare-and-swap.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "swarmauri_base"
|
|
3
|
-
version = "0.11.0.
|
|
3
|
+
version = "0.11.0.dev7"
|
|
4
4
|
description = "Reusable Swarmauri base classes, mixins, and dynamic Pydantic component models for composable intelligence infrastructure."
|
|
5
5
|
keywords = [
|
|
6
6
|
"swarmauri",
|
|
@@ -48,8 +48,9 @@ dependencies = [
|
|
|
48
48
|
"pyyaml>=6.0.2",
|
|
49
49
|
"numpy>=1.26.4",
|
|
50
50
|
"pydantic>=2.0",
|
|
51
|
-
"
|
|
52
|
-
"
|
|
51
|
+
"starlette",
|
|
52
|
+
"swarmauri_core>=0.11.0.dev7,<0.12",
|
|
53
|
+
"swarmauri_typing",
|
|
53
54
|
"toml>=0.10.2",
|
|
54
55
|
"tomli>=2.0; python_version < '3.11'"
|
|
55
56
|
]
|
|
@@ -62,7 +63,6 @@ swarmauri_tests_pylicense = { workspace = true }
|
|
|
62
63
|
[dependency-groups]
|
|
63
64
|
dev = [
|
|
64
65
|
"toml>=0.10.2",
|
|
65
|
-
"fastapi>=0.110.0",
|
|
66
66
|
"httpx>=0.27.0",
|
|
67
67
|
"pytest>=8.0.0",
|
|
68
68
|
"pytest-xdist>=3.6.1",
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
from abc import abstractmethod
|
|
2
|
+
|
|
3
|
+
from swarmauri_core.agents.IAgentCompaction import (
|
|
4
|
+
CountInputTokens,
|
|
5
|
+
IAgentCompaction,
|
|
6
|
+
)
|
|
7
|
+
from swarmauri_core.conversations.ICompactingConversation import (
|
|
8
|
+
CompactionPlan,
|
|
9
|
+
ICompactingConversation,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
from swarmauri_base.agents.AgentConversationMixin import AgentConversationMixin
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class AgentCompactionMixin(IAgentCompaction, AgentConversationMixin):
|
|
16
|
+
"""Orchestrate compaction with summarization supplied by the agent."""
|
|
17
|
+
|
|
18
|
+
@abstractmethod
|
|
19
|
+
def _summarize_compaction(self, plan: CompactionPlan) -> str:
|
|
20
|
+
"""Summarize the previous summary and eligible older messages."""
|
|
21
|
+
|
|
22
|
+
@abstractmethod
|
|
23
|
+
async def _asummarize_compaction(self, plan: CompactionPlan) -> str:
|
|
24
|
+
"""Asynchronously summarize the earlier conversation."""
|
|
25
|
+
|
|
26
|
+
def compact(self, *, count_input_tokens: CountInputTokens) -> bool:
|
|
27
|
+
conversation = self.conversation
|
|
28
|
+
if not isinstance(conversation, ICompactingConversation):
|
|
29
|
+
return False
|
|
30
|
+
plan = conversation.plan_compaction()
|
|
31
|
+
if plan is None:
|
|
32
|
+
return False
|
|
33
|
+
original_tokens = count_input_tokens(conversation.history)
|
|
34
|
+
summary = self._summarize_compaction(plan)
|
|
35
|
+
return self._apply_summary(
|
|
36
|
+
conversation, plan, summary, original_tokens, count_input_tokens
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
async def acompact(self, *, count_input_tokens: CountInputTokens) -> bool:
|
|
40
|
+
conversation = self.conversation
|
|
41
|
+
if not isinstance(conversation, ICompactingConversation):
|
|
42
|
+
return False
|
|
43
|
+
plan = conversation.plan_compaction()
|
|
44
|
+
if plan is None:
|
|
45
|
+
return False
|
|
46
|
+
original_tokens = count_input_tokens(conversation.history)
|
|
47
|
+
summary = await self._asummarize_compaction(plan)
|
|
48
|
+
return self._apply_summary(
|
|
49
|
+
conversation, plan, summary, original_tokens, count_input_tokens
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
def compact_if_needed(
|
|
53
|
+
self, *, count_input_tokens: CountInputTokens
|
|
54
|
+
) -> bool:
|
|
55
|
+
return self._compaction_needed(count_input_tokens) and self.compact(
|
|
56
|
+
count_input_tokens=count_input_tokens
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
async def acompact_if_needed(
|
|
60
|
+
self, *, count_input_tokens: CountInputTokens
|
|
61
|
+
) -> bool:
|
|
62
|
+
return self._compaction_needed(
|
|
63
|
+
count_input_tokens
|
|
64
|
+
) and await self.acompact(count_input_tokens=count_input_tokens)
|
|
65
|
+
|
|
66
|
+
def _compaction_needed(self, count_input_tokens: CountInputTokens) -> bool:
|
|
67
|
+
conversation = self.conversation
|
|
68
|
+
if not isinstance(conversation, ICompactingConversation):
|
|
69
|
+
return False
|
|
70
|
+
trigger = conversation.compaction_trigger_tokens
|
|
71
|
+
return (
|
|
72
|
+
trigger is not None
|
|
73
|
+
and count_input_tokens(conversation.history) >= trigger
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
def _apply_summary(
|
|
77
|
+
self,
|
|
78
|
+
conversation: ICompactingConversation,
|
|
79
|
+
plan: CompactionPlan,
|
|
80
|
+
summary: str,
|
|
81
|
+
original_tokens: int,
|
|
82
|
+
count_input_tokens: CountInputTokens,
|
|
83
|
+
) -> bool:
|
|
84
|
+
if self.conversation is not conversation or not summary.strip():
|
|
85
|
+
return False
|
|
86
|
+
proposed = conversation.preview_compaction(plan, summary)
|
|
87
|
+
if count_input_tokens(proposed) >= original_tokens:
|
|
88
|
+
return False
|
|
89
|
+
return conversation.apply_compaction(plan, summary)
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
from abc import abstractmethod
|
|
2
|
+
from collections.abc import Mapping, Sequence
|
|
3
|
+
from copy import deepcopy
|
|
4
|
+
|
|
5
|
+
from pydantic import Field
|
|
6
|
+
from swarmauri_core.conversations.ICompactingConversation import (
|
|
7
|
+
CompactionPlan,
|
|
8
|
+
ICompactingConversation,
|
|
9
|
+
)
|
|
10
|
+
from swarmauri_core.messages.IMessage import IMessage
|
|
11
|
+
|
|
12
|
+
from swarmauri_base.conversations.ConversationBase import ConversationBase
|
|
13
|
+
from swarmauri_base.messages.MessageBase import MessageBase
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ConversationCompactionMixin(ICompactingConversation, ConversationBase):
|
|
17
|
+
"""Plan and apply compaction independently of any model."""
|
|
18
|
+
|
|
19
|
+
summary: str | None = None
|
|
20
|
+
trigger_tokens: int | None = Field(default=None, gt=0)
|
|
21
|
+
keep_recent_turns: int = Field(default=4, ge=1)
|
|
22
|
+
|
|
23
|
+
@property
|
|
24
|
+
def compaction_trigger_tokens(self) -> int | None:
|
|
25
|
+
return self.trigger_tokens
|
|
26
|
+
|
|
27
|
+
@abstractmethod
|
|
28
|
+
def _summary_message(self, summary: str) -> MessageBase:
|
|
29
|
+
"""Render summary text as historical context."""
|
|
30
|
+
|
|
31
|
+
@staticmethod
|
|
32
|
+
def _instruction_end(messages: Sequence[MessageBase]) -> int:
|
|
33
|
+
for index, message in enumerate(messages):
|
|
34
|
+
if message.role not in {"system", "developer"}:
|
|
35
|
+
return index
|
|
36
|
+
return len(messages)
|
|
37
|
+
|
|
38
|
+
@property
|
|
39
|
+
def history(self) -> list[MessageBase]:
|
|
40
|
+
if not self.summary:
|
|
41
|
+
return list(self.messages)
|
|
42
|
+
start = self._instruction_end(self.messages)
|
|
43
|
+
return [
|
|
44
|
+
*self.messages[:start],
|
|
45
|
+
self._summary_message(self.summary),
|
|
46
|
+
*self.messages[start:],
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
@staticmethod
|
|
50
|
+
def _is_complete_turn(messages: Sequence[MessageBase]) -> bool:
|
|
51
|
+
"""Require a final reply and a result for every tool call."""
|
|
52
|
+
pending: set[str] = set()
|
|
53
|
+
answered = False
|
|
54
|
+
for message in messages[1:]:
|
|
55
|
+
if message.role == "assistant" and not pending:
|
|
56
|
+
for call in getattr(message, "tool_calls", None) or ():
|
|
57
|
+
call_id = (
|
|
58
|
+
call.get("id")
|
|
59
|
+
if isinstance(call, Mapping)
|
|
60
|
+
else getattr(call, "id", None)
|
|
61
|
+
)
|
|
62
|
+
if (
|
|
63
|
+
not isinstance(call_id, str)
|
|
64
|
+
or not call_id
|
|
65
|
+
or call_id in pending
|
|
66
|
+
):
|
|
67
|
+
return False
|
|
68
|
+
pending.add(call_id)
|
|
69
|
+
answered = not pending
|
|
70
|
+
elif message.role == "tool":
|
|
71
|
+
call_id = getattr(message, "tool_call_id", None)
|
|
72
|
+
if call_id not in pending:
|
|
73
|
+
return False
|
|
74
|
+
pending.remove(call_id)
|
|
75
|
+
else:
|
|
76
|
+
return False
|
|
77
|
+
return answered and not pending
|
|
78
|
+
|
|
79
|
+
def plan_compaction(self) -> CompactionPlan | None:
|
|
80
|
+
start = self._instruction_end(self.messages)
|
|
81
|
+
turns = [
|
|
82
|
+
index
|
|
83
|
+
for index in range(start, len(self.messages))
|
|
84
|
+
if self.messages[index].role == "user"
|
|
85
|
+
]
|
|
86
|
+
if not turns or turns[0] != start:
|
|
87
|
+
return None
|
|
88
|
+
|
|
89
|
+
stop = start
|
|
90
|
+
for begin, end in zip(turns[: -self.keep_recent_turns], turns[1:]):
|
|
91
|
+
if not self._is_complete_turn(self.messages[begin:end]):
|
|
92
|
+
break
|
|
93
|
+
stop = end
|
|
94
|
+
if stop == start:
|
|
95
|
+
return None
|
|
96
|
+
|
|
97
|
+
return CompactionPlan(
|
|
98
|
+
messages=tuple(deepcopy(self.messages)),
|
|
99
|
+
previous_summary=self.summary,
|
|
100
|
+
start=start,
|
|
101
|
+
stop=stop,
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
def preview_compaction(
|
|
105
|
+
self, plan: CompactionPlan, summary: str
|
|
106
|
+
) -> list[IMessage]:
|
|
107
|
+
return [
|
|
108
|
+
*plan.messages[: plan.start],
|
|
109
|
+
self._summary_message(summary.strip()),
|
|
110
|
+
*plan.messages[plan.stop :],
|
|
111
|
+
]
|
|
112
|
+
|
|
113
|
+
def apply_compaction(self, plan: CompactionPlan, summary: str) -> bool:
|
|
114
|
+
summary = summary.strip()
|
|
115
|
+
if not summary or self.plan_compaction() != plan:
|
|
116
|
+
return False
|
|
117
|
+
|
|
118
|
+
self.messages = (
|
|
119
|
+
self.messages[: plan.start] + self.messages[plan.stop :]
|
|
120
|
+
)
|
|
121
|
+
self.summary = summary
|
|
122
|
+
return True
|
|
123
|
+
|
|
124
|
+
def clear_history(self) -> None:
|
|
125
|
+
super().clear_history()
|
|
126
|
+
self.summary = None
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"""Read optional project configuration without depending on a plugin host."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
try:
|
|
9
|
+
import tomllib
|
|
10
|
+
except ImportError:
|
|
11
|
+
import tomli as tomllib
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def load_filter_config() -> dict:
|
|
15
|
+
"""Read PEAGEN_CONFIG or the nearest peagen.toml if present."""
|
|
16
|
+
configured = os.environ.get("PEAGEN_CONFIG")
|
|
17
|
+
if configured:
|
|
18
|
+
path = Path(configured).expanduser()
|
|
19
|
+
with path.open("rb") as stream:
|
|
20
|
+
return tomllib.load(stream)
|
|
21
|
+
current = Path.cwd()
|
|
22
|
+
for directory in (current, *current.parents):
|
|
23
|
+
path = directory / "peagen.toml"
|
|
24
|
+
if path.is_file():
|
|
25
|
+
with path.open("rb") as stream:
|
|
26
|
+
return tomllib.load(stream)
|
|
27
|
+
return {}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from collections.abc import Awaitable, Callable
|
|
4
|
-
from typing import
|
|
4
|
+
from typing import Any
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
from starlette.requests import Request
|
|
7
|
+
from starlette.responses import Response
|
|
8
8
|
|
|
9
9
|
from swarmauri_core.middlewares.IMiddleware import (
|
|
10
10
|
ASGIApp,
|
|
@@ -83,13 +83,6 @@ class MiddlewareBase(IMiddleware, ComponentBase):
|
|
|
83
83
|
async def _dispatch_with_request(
|
|
84
84
|
self, scope: Scope, receive: ReceiveCallable, send: SendCallable
|
|
85
85
|
) -> None:
|
|
86
|
-
try:
|
|
87
|
-
from fastapi import Request, Response
|
|
88
|
-
except ImportError as exc: # pragma: no cover - optional dependency
|
|
89
|
-
raise RuntimeError(
|
|
90
|
-
"FastAPI must be installed to use dispatch-style middleware."
|
|
91
|
-
) from exc
|
|
92
|
-
|
|
93
86
|
request = Request(scope, receive=receive)
|
|
94
87
|
|
|
95
88
|
async def call_next(request: Request) -> Response:
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import subprocess
|
|
2
|
+
from dataclasses import replace
|
|
3
|
+
from threading import Lock, Timer
|
|
4
|
+
from uuid import uuid4
|
|
5
|
+
|
|
6
|
+
from swarmauri_core.processes import (
|
|
7
|
+
IProcessBackend,
|
|
8
|
+
ProcessHandle,
|
|
9
|
+
ProcessRequest,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
# Coordinate launch and cancellation inside the target Linux environment.
|
|
13
|
+
# The lock closes the race between publishing the PID and a cancellation.
|
|
14
|
+
_LAUNCH = """
|
|
15
|
+
import fcntl, os, pathlib, subprocess, sys
|
|
16
|
+
root = pathlib.Path('/tmp') / ('swarmauri-' + sys.argv[1])
|
|
17
|
+
root.mkdir(mode=0o700, exist_ok=True)
|
|
18
|
+
with (root / 'lock').open('a') as lock:
|
|
19
|
+
fcntl.flock(lock, fcntl.LOCK_EX)
|
|
20
|
+
if (root / 'cancel').exists():
|
|
21
|
+
sys.exit(125)
|
|
22
|
+
if sys.argv[2]:
|
|
23
|
+
os.chdir(sys.argv[2])
|
|
24
|
+
process = subprocess.Popen(
|
|
25
|
+
sys.argv[3:], start_new_session=True, stdin=sys.stdin.buffer
|
|
26
|
+
)
|
|
27
|
+
(root / 'pid').write_text(str(process.pid))
|
|
28
|
+
status = process.wait()
|
|
29
|
+
with (root / 'lock').open('a') as lock:
|
|
30
|
+
fcntl.flock(lock, fcntl.LOCK_EX)
|
|
31
|
+
(root / 'pid').unlink(missing_ok=True)
|
|
32
|
+
(root / 'done').touch()
|
|
33
|
+
sys.exit(status if status >= 0 else 128 - status)
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
_CANCEL = """
|
|
37
|
+
import fcntl, os, pathlib, signal, sys
|
|
38
|
+
root = pathlib.Path('/tmp') / ('swarmauri-' + sys.argv[1])
|
|
39
|
+
root.mkdir(mode=0o700, exist_ok=True)
|
|
40
|
+
with (root / 'lock').open('a') as lock:
|
|
41
|
+
fcntl.flock(lock, fcntl.LOCK_EX)
|
|
42
|
+
if (root / 'done').exists():
|
|
43
|
+
print('finished')
|
|
44
|
+
sys.exit(0)
|
|
45
|
+
(root / 'cancel').touch()
|
|
46
|
+
try:
|
|
47
|
+
os.killpg(int((root / 'pid').read_text()), signal.SIGKILL)
|
|
48
|
+
except (FileNotFoundError, ProcessLookupError):
|
|
49
|
+
pass
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
_CLEAN = """
|
|
53
|
+
import pathlib, shutil, sys
|
|
54
|
+
root = pathlib.Path('/tmp') / ('swarmauri-' + sys.argv[1])
|
|
55
|
+
if root.exists():
|
|
56
|
+
shutil.rmtree(root)
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class ContainerProcessBackendBase(IProcessBackend):
|
|
61
|
+
"""Share process control across container command transports."""
|
|
62
|
+
|
|
63
|
+
def __init__(self, transport: IProcessBackend):
|
|
64
|
+
self.transport = transport
|
|
65
|
+
self._runs = {}
|
|
66
|
+
self._lock = Lock()
|
|
67
|
+
|
|
68
|
+
def _exec(self, workspace: str, argv: tuple[str, ...], interactive=False):
|
|
69
|
+
raise NotImplementedError
|
|
70
|
+
|
|
71
|
+
@staticmethod
|
|
72
|
+
def _control(argv: tuple[str, ...]) -> str:
|
|
73
|
+
return subprocess.run(
|
|
74
|
+
argv,
|
|
75
|
+
check=True,
|
|
76
|
+
capture_output=True,
|
|
77
|
+
text=True,
|
|
78
|
+
timeout=30,
|
|
79
|
+
).stdout
|
|
80
|
+
|
|
81
|
+
def start(self, request: ProcessRequest) -> ProcessHandle:
|
|
82
|
+
if not request.workspace:
|
|
83
|
+
raise ValueError("A container workspace is required")
|
|
84
|
+
token = uuid4().hex
|
|
85
|
+
environment = tuple(
|
|
86
|
+
f"{key}={value}" for key, value in (request.env or {}).items()
|
|
87
|
+
)
|
|
88
|
+
argv = (
|
|
89
|
+
"env",
|
|
90
|
+
"--",
|
|
91
|
+
*environment,
|
|
92
|
+
"python3",
|
|
93
|
+
"-c",
|
|
94
|
+
_LAUNCH,
|
|
95
|
+
token,
|
|
96
|
+
request.cwd or "",
|
|
97
|
+
*request.argv,
|
|
98
|
+
)
|
|
99
|
+
handle = self.transport.start(
|
|
100
|
+
ProcessRequest(
|
|
101
|
+
self._exec(request.workspace, argv, interactive=True),
|
|
102
|
+
)
|
|
103
|
+
)
|
|
104
|
+
timer = None
|
|
105
|
+
if request.timeout is not None:
|
|
106
|
+
timer = Timer(
|
|
107
|
+
request.timeout, self._cancel, args=(handle, "timed_out")
|
|
108
|
+
)
|
|
109
|
+
timer.daemon = True
|
|
110
|
+
with self._lock:
|
|
111
|
+
self._runs[handle.id] = (request.workspace, token, timer, None)
|
|
112
|
+
if timer is not None:
|
|
113
|
+
timer.start()
|
|
114
|
+
return handle
|
|
115
|
+
|
|
116
|
+
def read(self, handle, *, after=0, wait=0):
|
|
117
|
+
page = self.transport.read(handle, after=after, wait=wait)
|
|
118
|
+
if page.events and page.events[-1].kind == "exit":
|
|
119
|
+
with self._lock:
|
|
120
|
+
_, _, timer, outcome = self._runs[handle.id]
|
|
121
|
+
if timer is not None:
|
|
122
|
+
timer.cancel()
|
|
123
|
+
if outcome is not None:
|
|
124
|
+
event = replace(page.events[-1], outcome=outcome)
|
|
125
|
+
return replace(page, events=(*page.events[:-1], event))
|
|
126
|
+
return page
|
|
127
|
+
|
|
128
|
+
def write_stdin(self, handle, data, *, close=False):
|
|
129
|
+
self.transport.write_stdin(handle, data, close=close)
|
|
130
|
+
|
|
131
|
+
def _cancel(self, handle, outcome):
|
|
132
|
+
with self._lock:
|
|
133
|
+
if handle.id not in self._runs:
|
|
134
|
+
return False
|
|
135
|
+
workspace, token, timer, prior = self._runs[handle.id]
|
|
136
|
+
if prior is not None:
|
|
137
|
+
return False
|
|
138
|
+
response = self._control(
|
|
139
|
+
self._exec(workspace, ("python3", "-c", _CANCEL, token))
|
|
140
|
+
)
|
|
141
|
+
if response.strip() == "finished":
|
|
142
|
+
return False
|
|
143
|
+
self._runs[handle.id] = (workspace, token, timer, outcome)
|
|
144
|
+
return True
|
|
145
|
+
|
|
146
|
+
def cancel(self, handle):
|
|
147
|
+
return self._cancel(handle, "cancelled")
|
|
148
|
+
|
|
149
|
+
def release(self, handle):
|
|
150
|
+
with self._lock:
|
|
151
|
+
workspace, token, timer, _ = self._runs[handle.id]
|
|
152
|
+
page = self.transport.read(handle)
|
|
153
|
+
if not page.events or page.events[-1].kind != "exit":
|
|
154
|
+
raise ValueError("Release requires a completed process")
|
|
155
|
+
if timer is not None:
|
|
156
|
+
timer.cancel()
|
|
157
|
+
self._control(
|
|
158
|
+
self._exec(workspace, ("python3", "-c", _CLEAN, token))
|
|
159
|
+
)
|
|
160
|
+
self.transport.release(handle)
|
|
161
|
+
del self._runs[handle.id]
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"""Execute subprocesses for the kernel and standalone tool surfaces."""
|
|
2
|
+
|
|
3
|
+
import ctypes
|
|
4
|
+
import locale
|
|
5
|
+
import os
|
|
6
|
+
import shlex
|
|
7
|
+
import subprocess
|
|
8
|
+
import sys
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
from tempfile import NamedTemporaryFile
|
|
11
|
+
from typing import Dict, List, Optional, Union
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _windows_executable(command: str) -> str:
|
|
15
|
+
"""Select a native image with the documented CreateProcess search order."""
|
|
16
|
+
from _winapi import GetModuleFileName
|
|
17
|
+
|
|
18
|
+
def directory(query) -> Path:
|
|
19
|
+
buffer = ctypes.create_unicode_buffer(32768)
|
|
20
|
+
length = query(buffer, len(buffer))
|
|
21
|
+
if not 0 < length < len(buffer):
|
|
22
|
+
raise ctypes.WinError(ctypes.get_last_error())
|
|
23
|
+
return Path(buffer.value)
|
|
24
|
+
|
|
25
|
+
candidate = Path(command)
|
|
26
|
+
bare = candidate.name == command
|
|
27
|
+
if bare and not candidate.suffix and not command.endswith("."):
|
|
28
|
+
candidate = candidate.with_suffix(".exe")
|
|
29
|
+
if candidate.suffix.lower() not in {".exe", ".com"}:
|
|
30
|
+
raise ValueError("Windows shell=False requires a native .exe or .com")
|
|
31
|
+
|
|
32
|
+
if bare:
|
|
33
|
+
kernel = ctypes.WinDLL("kernel32", use_last_error=True)
|
|
34
|
+
windows = directory(kernel.GetWindowsDirectoryW)
|
|
35
|
+
folders = [
|
|
36
|
+
Path(GetModuleFileName(0)).parent,
|
|
37
|
+
Path.cwd(),
|
|
38
|
+
directory(kernel.GetSystemDirectoryW),
|
|
39
|
+
windows / "System",
|
|
40
|
+
windows,
|
|
41
|
+
*(
|
|
42
|
+
Path(path.strip('"'))
|
|
43
|
+
for path in os.environ.get("PATH", "").split(os.pathsep)
|
|
44
|
+
if path
|
|
45
|
+
),
|
|
46
|
+
]
|
|
47
|
+
matches = (folder / candidate for folder in folders)
|
|
48
|
+
else:
|
|
49
|
+
matches = iter((candidate,))
|
|
50
|
+
|
|
51
|
+
for match in matches:
|
|
52
|
+
if match.is_file():
|
|
53
|
+
image = match.resolve(strict=True)
|
|
54
|
+
if image.suffix.lower() not in {".exe", ".com"}:
|
|
55
|
+
raise ValueError(
|
|
56
|
+
"Windows shell=False requires a native .exe or .com"
|
|
57
|
+
)
|
|
58
|
+
return str(image)
|
|
59
|
+
raise FileNotFoundError(command)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def _read_windows_capture(capture) -> str:
|
|
63
|
+
"""Read a bounded snapshot without disturbing an inherited write offset."""
|
|
64
|
+
size = os.fstat(capture.fileno()).st_size
|
|
65
|
+
descriptor = os.open(
|
|
66
|
+
capture.name, os.O_RDONLY | os.O_BINARY | os.O_TEMPORARY
|
|
67
|
+
)
|
|
68
|
+
with os.fdopen(descriptor, "rb") as reader:
|
|
69
|
+
data = reader.read(size)
|
|
70
|
+
encoding = (
|
|
71
|
+
"utf-8" if sys.flags.utf8_mode else locale.getpreferredencoding(False)
|
|
72
|
+
)
|
|
73
|
+
return data.decode(encoding).replace("\r\n", "\n").replace("\r", "\n")
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def run_subprocess(
|
|
77
|
+
command: Union[str, List[str]],
|
|
78
|
+
timeout: Optional[float] = None,
|
|
79
|
+
shell: bool = False,
|
|
80
|
+
cwd: Optional[str] = None,
|
|
81
|
+
env: Optional[Dict[str, str]] = None,
|
|
82
|
+
) -> Dict[str, Union[str, int, None]]:
|
|
83
|
+
"""Run a command with the shared platform and result policies."""
|
|
84
|
+
try:
|
|
85
|
+
args: Union[str, List[str]]
|
|
86
|
+
if isinstance(command, str):
|
|
87
|
+
args = command if shell else shlex.split(command)
|
|
88
|
+
elif isinstance(command, list):
|
|
89
|
+
if shell:
|
|
90
|
+
raise ValueError("shell=True requires a command string")
|
|
91
|
+
if not all(isinstance(arg, str) for arg in command):
|
|
92
|
+
raise ValueError("command arguments must be strings")
|
|
93
|
+
args = command
|
|
94
|
+
else:
|
|
95
|
+
raise ValueError("command must be a string or argument list")
|
|
96
|
+
if not args:
|
|
97
|
+
raise ValueError("command must not be empty")
|
|
98
|
+
|
|
99
|
+
executable = None
|
|
100
|
+
if os.name == "nt" and not shell:
|
|
101
|
+
executable = _windows_executable(args[0])
|
|
102
|
+
|
|
103
|
+
options = {
|
|
104
|
+
"executable": executable,
|
|
105
|
+
"shell": shell,
|
|
106
|
+
"timeout": timeout,
|
|
107
|
+
"cwd": cwd,
|
|
108
|
+
"env": env,
|
|
109
|
+
}
|
|
110
|
+
if os.name == "nt" and timeout is not None:
|
|
111
|
+
with (
|
|
112
|
+
NamedTemporaryFile() as stdout,
|
|
113
|
+
NamedTemporaryFile() as stderr,
|
|
114
|
+
):
|
|
115
|
+
result = subprocess.run(
|
|
116
|
+
args, stdout=stdout, stderr=stderr, **options
|
|
117
|
+
)
|
|
118
|
+
result.stdout = _read_windows_capture(stdout)
|
|
119
|
+
result.stderr = _read_windows_capture(stderr)
|
|
120
|
+
else:
|
|
121
|
+
result = subprocess.run(
|
|
122
|
+
args, capture_output=True, text=True, **options
|
|
123
|
+
)
|
|
124
|
+
return {
|
|
125
|
+
"status": "success",
|
|
126
|
+
"stdout": result.stdout,
|
|
127
|
+
"stderr": result.stderr,
|
|
128
|
+
"exit_code": result.returncode,
|
|
129
|
+
}
|
|
130
|
+
except subprocess.TimeoutExpired:
|
|
131
|
+
return {
|
|
132
|
+
"status": "timeout",
|
|
133
|
+
"stdout": "",
|
|
134
|
+
"stderr": f"Process timed out after {timeout} seconds",
|
|
135
|
+
"exit_code": None,
|
|
136
|
+
}
|
|
137
|
+
except FileNotFoundError:
|
|
138
|
+
return {
|
|
139
|
+
"status": "not_found",
|
|
140
|
+
"stdout": "",
|
|
141
|
+
"stderr": (
|
|
142
|
+
"Executable not found: "
|
|
143
|
+
f"{args[0] if isinstance(args, list) else args}"
|
|
144
|
+
),
|
|
145
|
+
"exit_code": 127,
|
|
146
|
+
}
|
|
147
|
+
except Exception as e:
|
|
148
|
+
return {
|
|
149
|
+
"status": "runtime_error",
|
|
150
|
+
"stdout": "",
|
|
151
|
+
"stderr": str(e),
|
|
152
|
+
"exit_code": None,
|
|
153
|
+
}
|