omnibase_infra 0.2.2__py3-none-any.whl → 0.2.3__py3-none-any.whl
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.
- omnibase_infra/__init__.py +1 -1
- omnibase_infra/adapters/adapter_onex_tool_execution.py +6 -1
- omnibase_infra/capabilities/__init__.py +15 -0
- omnibase_infra/capabilities/capability_inference_rules.py +211 -0
- omnibase_infra/capabilities/contract_capability_extractor.py +221 -0
- omnibase_infra/capabilities/intent_type_extractor.py +160 -0
- omnibase_infra/contracts/handlers/filesystem/handler_contract.yaml +1 -1
- omnibase_infra/contracts/handlers/mcp/handler_contract.yaml +1 -1
- omnibase_infra/enums/__init__.py +6 -0
- omnibase_infra/enums/enum_handler_error_type.py +10 -0
- omnibase_infra/enums/enum_handler_source_mode.py +72 -0
- omnibase_infra/enums/enum_kafka_acks.py +99 -0
- omnibase_infra/event_bus/event_bus_kafka.py +1 -1
- omnibase_infra/event_bus/models/config/model_kafka_event_bus_config.py +59 -10
- omnibase_infra/handlers/__init__.py +8 -1
- omnibase_infra/handlers/handler_consul.py +7 -1
- omnibase_infra/handlers/handler_db.py +8 -2
- omnibase_infra/handlers/handler_http.py +8 -2
- omnibase_infra/handlers/handler_intent.py +387 -0
- omnibase_infra/handlers/handler_mcp.py +10 -1
- omnibase_infra/handlers/handler_vault.py +11 -5
- omnibase_infra/handlers/registration_storage/handler_registration_storage_postgres.py +7 -0
- omnibase_infra/handlers/service_discovery/handler_service_discovery_consul.py +7 -0
- omnibase_infra/mixins/mixin_node_introspection.py +18 -0
- omnibase_infra/models/discovery/model_introspection_config.py +11 -0
- omnibase_infra/models/handlers/__init__.py +38 -5
- omnibase_infra/models/handlers/model_bootstrap_handler_descriptor.py +4 -4
- omnibase_infra/models/handlers/model_contract_discovery_result.py +6 -4
- omnibase_infra/models/handlers/model_handler_source_config.py +220 -0
- omnibase_infra/models/registration/model_node_introspection_event.py +9 -0
- omnibase_infra/models/runtime/model_handler_contract.py +25 -9
- omnibase_infra/models/runtime/model_loaded_handler.py +9 -0
- omnibase_infra/nodes/node_registration_orchestrator/plugin.py +1 -1
- omnibase_infra/nodes/node_registration_orchestrator/registry/registry_infra_node_registration_orchestrator.py +7 -7
- omnibase_infra/nodes/node_registration_orchestrator/timeout_coordinator.py +4 -3
- omnibase_infra/nodes/node_registration_storage_effect/node.py +4 -1
- omnibase_infra/nodes/node_registration_storage_effect/registry/registry_infra_registration_storage.py +1 -1
- omnibase_infra/nodes/node_service_discovery_effect/registry/registry_infra_service_discovery.py +4 -1
- omnibase_infra/protocols/__init__.py +2 -0
- omnibase_infra/protocols/protocol_container_aware.py +200 -0
- omnibase_infra/runtime/__init__.py +39 -0
- omnibase_infra/runtime/handler_bootstrap_source.py +26 -33
- omnibase_infra/runtime/handler_contract_config_loader.py +1 -1
- omnibase_infra/runtime/handler_contract_source.py +10 -51
- omnibase_infra/runtime/handler_identity.py +81 -0
- omnibase_infra/runtime/handler_plugin_loader.py +15 -0
- omnibase_infra/runtime/handler_registry.py +11 -3
- omnibase_infra/runtime/handler_source_resolver.py +326 -0
- omnibase_infra/runtime/protocol_lifecycle_executor.py +6 -6
- omnibase_infra/runtime/registry/registry_protocol_binding.py +13 -13
- omnibase_infra/runtime/registry_contract_source.py +693 -0
- omnibase_infra/runtime/service_kernel.py +1 -1
- omnibase_infra/runtime/service_runtime_host_process.py +463 -190
- omnibase_infra/runtime/util_wiring.py +12 -3
- omnibase_infra/services/__init__.py +21 -0
- omnibase_infra/services/corpus_capture.py +7 -1
- omnibase_infra/services/mcp/mcp_server_lifecycle.py +9 -3
- omnibase_infra/services/registry_api/main.py +31 -13
- omnibase_infra/services/registry_api/service.py +10 -19
- omnibase_infra/services/service_timeout_emitter.py +7 -1
- omnibase_infra/services/service_timeout_scanner.py +7 -3
- omnibase_infra/services/session/__init__.py +56 -0
- omnibase_infra/services/session/config_consumer.py +120 -0
- omnibase_infra/services/session/config_store.py +139 -0
- omnibase_infra/services/session/consumer.py +1007 -0
- omnibase_infra/services/session/protocol_session_aggregator.py +117 -0
- omnibase_infra/services/session/store.py +997 -0
- omnibase_infra/utils/__init__.py +19 -0
- omnibase_infra/utils/util_atomic_file.py +261 -0
- omnibase_infra/utils/util_db_transaction.py +239 -0
- omnibase_infra/utils/util_retry_optimistic.py +281 -0
- omnibase_infra/validation/validation_exemptions.yaml +27 -0
- {omnibase_infra-0.2.2.dist-info → omnibase_infra-0.2.3.dist-info}/METADATA +3 -3
- {omnibase_infra-0.2.2.dist-info → omnibase_infra-0.2.3.dist-info}/RECORD +77 -56
- {omnibase_infra-0.2.2.dist-info → omnibase_infra-0.2.3.dist-info}/WHEEL +0 -0
- {omnibase_infra-0.2.2.dist-info → omnibase_infra-0.2.3.dist-info}/entry_points.txt +0 -0
- {omnibase_infra-0.2.2.dist-info → omnibase_infra-0.2.3.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT
|
|
2
|
+
# Copyright (c) 2025 OmniNode Team
|
|
3
|
+
"""Protocol definition for session aggregators.
|
|
4
|
+
|
|
5
|
+
Defines the interface that session aggregators must implement
|
|
6
|
+
to work with the SessionEventConsumer.
|
|
7
|
+
|
|
8
|
+
TODO(OMN-1526): This protocol was originally in omniclaude.aggregators.
|
|
9
|
+
Consider moving to omnibase_infra.protocols for reuse.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
from datetime import datetime
|
|
15
|
+
from typing import Protocol
|
|
16
|
+
from uuid import UUID
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ProtocolSessionAggregator(Protocol):
|
|
20
|
+
"""Protocol for session aggregators.
|
|
21
|
+
|
|
22
|
+
Session aggregators process events from the SessionEventConsumer
|
|
23
|
+
and maintain session state. Implementations must be idempotent
|
|
24
|
+
to support at-least-once delivery semantics.
|
|
25
|
+
|
|
26
|
+
Example:
|
|
27
|
+
>>> class MyAggregator:
|
|
28
|
+
... @property
|
|
29
|
+
... def aggregator_id(self) -> str:
|
|
30
|
+
... return "my-aggregator"
|
|
31
|
+
...
|
|
32
|
+
... async def process_event(self, event: object, correlation_id: UUID) -> bool:
|
|
33
|
+
... # Process event and return True if accepted
|
|
34
|
+
... return True
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
@property
|
|
38
|
+
def aggregator_id(self) -> str:
|
|
39
|
+
"""Get the unique aggregator identifier.
|
|
40
|
+
|
|
41
|
+
Returns:
|
|
42
|
+
Unique string identifier for this aggregator instance.
|
|
43
|
+
"""
|
|
44
|
+
...
|
|
45
|
+
|
|
46
|
+
async def process_event(self, event: object, correlation_id: UUID) -> bool:
|
|
47
|
+
"""Process a session event.
|
|
48
|
+
|
|
49
|
+
Args:
|
|
50
|
+
event: The event to process. May be a JSON string or
|
|
51
|
+
a pre-parsed event envelope, depending on consumer configuration.
|
|
52
|
+
correlation_id: Correlation ID for tracing.
|
|
53
|
+
|
|
54
|
+
Returns:
|
|
55
|
+
True if processed successfully, False if rejected (e.g., duplicate).
|
|
56
|
+
|
|
57
|
+
Raises:
|
|
58
|
+
Exception: On processing failure. Consumer will handle retry/circuit breaker.
|
|
59
|
+
"""
|
|
60
|
+
...
|
|
61
|
+
|
|
62
|
+
async def get_snapshot(
|
|
63
|
+
self, session_id: str, correlation_id: UUID
|
|
64
|
+
) -> object | None:
|
|
65
|
+
"""Get current snapshot for a session.
|
|
66
|
+
|
|
67
|
+
Args:
|
|
68
|
+
session_id: The session identifier.
|
|
69
|
+
correlation_id: Correlation ID for tracing.
|
|
70
|
+
|
|
71
|
+
Returns:
|
|
72
|
+
Session snapshot object, or None if session not found.
|
|
73
|
+
"""
|
|
74
|
+
...
|
|
75
|
+
|
|
76
|
+
async def finalize_session(
|
|
77
|
+
self, session_id: str, correlation_id: UUID, reason: str | None = None
|
|
78
|
+
) -> object | None:
|
|
79
|
+
"""Finalize a session, marking it as ended.
|
|
80
|
+
|
|
81
|
+
Args:
|
|
82
|
+
session_id: The session identifier.
|
|
83
|
+
correlation_id: Correlation ID for tracing.
|
|
84
|
+
reason: Optional reason for session end.
|
|
85
|
+
|
|
86
|
+
Returns:
|
|
87
|
+
Final session snapshot, or None if session not found.
|
|
88
|
+
"""
|
|
89
|
+
...
|
|
90
|
+
|
|
91
|
+
async def get_active_sessions(self, correlation_id: UUID) -> list[str]:
|
|
92
|
+
"""Get list of active session IDs.
|
|
93
|
+
|
|
94
|
+
Args:
|
|
95
|
+
correlation_id: Correlation ID for tracing.
|
|
96
|
+
|
|
97
|
+
Returns:
|
|
98
|
+
List of active session ID strings.
|
|
99
|
+
"""
|
|
100
|
+
...
|
|
101
|
+
|
|
102
|
+
async def get_session_last_activity(
|
|
103
|
+
self, session_id: str, correlation_id: UUID
|
|
104
|
+
) -> datetime | None:
|
|
105
|
+
"""Get last activity timestamp for a session.
|
|
106
|
+
|
|
107
|
+
Args:
|
|
108
|
+
session_id: The session identifier.
|
|
109
|
+
correlation_id: Correlation ID for tracing.
|
|
110
|
+
|
|
111
|
+
Returns:
|
|
112
|
+
Last activity datetime, or None if session not found.
|
|
113
|
+
"""
|
|
114
|
+
...
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
__all__ = ["ProtocolSessionAggregator"]
|