krons 0.1.0__tar.gz → 0.1.1__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.
- {krons-0.1.0 → krons-0.1.1}/CLAUDE.md +17 -17
- {krons-0.1.0 → krons-0.1.1}/PKG-INFO +5 -5
- {krons-0.1.0 → krons-0.1.1}/README.md +1 -1
- {krons-0.1.0 → krons-0.1.1}/pyproject.toml +6 -6
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/core/__init__.py +31 -31
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/core/broadcaster.py +1 -1
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/core/element.py +3 -3
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/core/event.py +4 -4
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/core/eventbus.py +1 -1
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/core/flow.py +4 -4
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/core/graph.py +4 -4
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/core/node.py +11 -11
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/core/pile.py +5 -5
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/core/processor.py +2 -2
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/core/progression.py +2 -2
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/enforcement/__init__.py +1 -1
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/enforcement/context.py +3 -3
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/enforcement/policy.py +3 -3
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/enforcement/rule.py +2 -2
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/enforcement/service.py +1 -1
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/enforcement/validator.py +3 -3
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/operations/builder.py +4 -4
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/operations/flow.py +5 -5
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/operations/node.py +3 -3
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/services/__init__.py +13 -13
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/services/backend.py +3 -3
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/services/hook.py +3 -3
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/services/imodel.py +5 -5
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/services/registry.py +2 -2
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/services/utilities/rate_limited_executor.py +4 -4
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/services/utilities/rate_limiter.py +1 -1
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/services/utilities/resilience.py +2 -2
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/session/exchange.py +3 -3
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/session/message.py +1 -1
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/session/session.py +7 -7
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/specs/adapters/dataclass_field.py +4 -4
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/specs/adapters/pydantic_adapter.py +5 -5
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/specs/adapters/sql_ddl.py +6 -6
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/specs/catalog/__init__.py +2 -2
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/specs/catalog/_audit.py +3 -3
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/specs/catalog/_common.py +2 -2
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/specs/catalog/_content.py +5 -5
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/specs/catalog/_enforcement.py +4 -4
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/specs/factory.py +7 -7
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/specs/operable.py +2 -2
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/specs/phrase.py +4 -4
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/specs/protocol.py +1 -1
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/specs/spec.py +7 -7
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/types/base.py +3 -3
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/types/db_types.py +2 -2
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/types/identity.py +1 -1
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/_to_list.py +1 -1
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/_utils.py +3 -3
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/concurrency/__init__.py +38 -38
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/concurrency/_async_call.py +3 -3
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/fuzzy/_fuzzy_match.py +2 -2
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/sql/_sql_validation.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/conftest.py +3 -3
- {krons-0.1.0 → krons-0.1.1}/tests/core/test_broadcaster.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/core/test_element.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/core/test_error_paths.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/core/test_event.py +3 -3
- {krons-0.1.0 → krons-0.1.1}/tests/core/test_event_status_race.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/core/test_eventbus.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/core/test_flow.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/core/test_flow_edge_cases.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/core/test_graph.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/core/test_graph_event_loop.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/core/test_node.py +10 -10
- {krons-0.1.0 → krons-0.1.1}/tests/core/test_pile.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/core/test_pile_edge_cases.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/core/test_processor.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/core/test_processor_security.py +5 -5
- {krons-0.1.0 → krons-0.1.1}/tests/core/test_progression.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/core/test_progression_edge_cases.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/core/test_serialization_roundtrip.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/core/test_thread_safety_stress.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/enforcement/test_service.py +25 -25
- {krons-0.1.0 → krons-0.1.1}/tests/operations/test_builder.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/operations/test_flow.py +4 -4
- {krons-0.1.0 → krons-0.1.1}/tests/operations/test_node.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/operations/test_op_flow.py +15 -15
- {krons-0.1.0 → krons-0.1.1}/tests/operations/test_op_node.py +3 -3
- {krons-0.1.0 → krons-0.1.1}/tests/operations/test_registry.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/rules/test_base.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/rules/test_builtin.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/rules/test_registry.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/rules/test_rule_params_edge_cases.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/rules/test_rules_comprehensive.py +3 -3
- {krons-0.1.0 → krons-0.1.1}/tests/rules/test_validator.py +3 -3
- {krons-0.1.0 → krons-0.1.1}/tests/services/test_backend.py +3 -3
- {krons-0.1.0 → krons-0.1.1}/tests/services/test_endpoint.py +3 -3
- {krons-0.1.0 → krons-0.1.1}/tests/services/test_hook.py +8 -8
- {krons-0.1.0 → krons-0.1.1}/tests/services/test_imodel.py +5 -5
- {krons-0.1.0 → krons-0.1.1}/tests/services/test_registry.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/services/utilities/test_header_factory.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/services/utilities/test_rate_limiter.py +4 -4
- {krons-0.1.0 → krons-0.1.1}/tests/services/utilities/test_resilience.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/services/utilities/test_resilience_retry.py +9 -9
- {krons-0.1.0 → krons-0.1.1}/tests/session/test_exchange.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/session/test_message.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/session/test_message_edge_cases.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/session/test_session.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/session/test_session_edge_cases.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/specs/test_catalog.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/specs/test_factory.py +8 -8
- {krons-0.1.0 → krons-0.1.1}/tests/specs/test_phrase.py +4 -4
- {krons-0.1.0 → krons-0.1.1}/tests/test_protocols.py +6 -6
- {krons-0.1.0 → krons-0.1.1}/tests/types/conftest.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/types/spec_adapters/test_adapters_py311.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/types/spec_adapters/test_protocol.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/types/spec_adapters/test_pydantic_field.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/types/spec_adapters/test_sql_ddl_specs.py +4 -4
- {krons-0.1.0 → krons-0.1.1}/tests/types/test_db_types.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/types/test_identity.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/types/test_model.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/types/test_operable.py +3 -3
- {krons-0.1.0 → krons-0.1.1}/tests/types/test_sentinel.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/types/test_spec.py +12 -12
- {krons-0.1.0 → krons-0.1.1}/tests/types/test_types.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/types/test_types_py311.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/utils/concurrency/test_async_call.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/utils/concurrency/test_cancel.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/utils/concurrency/test_errors.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/utils/concurrency/test_patterns.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/utils/concurrency/test_primitives.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/utils/concurrency/test_priority_queue.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/utils/concurrency/test_run_async.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/utils/concurrency/test_task.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/utils/concurrency/test_utils.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/utils/test_extract_json.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/utils/test_fuzzy_json.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/utils/test_fuzzy_match.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/utils/test_hash.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/utils/test_json_dump.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/utils/test_lazy_init.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/utils/test_sql_validation.py +2 -2
- {krons-0.1.0 → krons-0.1.1}/tests/utils/test_string_similarity.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/utils/test_to_dict.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/utils/test_to_list.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/utils/test_to_num.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/tests/utils/test_utils.py +1 -1
- {krons-0.1.0 → krons-0.1.1}/uv.lock +2 -2
- {krons-0.1.0 → krons-0.1.1}/.github/workflows/release.yml +0 -0
- {krons-0.1.0 → krons-0.1.1}/.gitignore +0 -0
- {krons-0.1.0 → krons-0.1.1}/.python-version +0 -0
- {krons-0.1.0 → krons-0.1.1}/LICENSE +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/__init__.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/enforcement/common/__init__.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/enforcement/common/boolean.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/enforcement/common/choice.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/enforcement/common/mapping.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/enforcement/common/model.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/enforcement/common/number.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/enforcement/common/string.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/enforcement/registry.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/errors.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/operations/__init__.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/operations/registry.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/protocols.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/py.typed +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/services/endpoint.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/services/utilities/__init__.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/services/utilities/header_factory.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/session/__init__.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/specs/__init__.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/specs/adapters/__init__.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/specs/adapters/_utils.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/specs/adapters/factory.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/types/__init__.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/types/_sentinel.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/__init__.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/_hash.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/_json_dump.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/_lazy_init.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/_to_num.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/concurrency/_cancel.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/concurrency/_errors.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/concurrency/_patterns.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/concurrency/_primitives.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/concurrency/_priority_queue.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/concurrency/_resource_tracker.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/concurrency/_run_async.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/concurrency/_task.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/concurrency/_utils.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/fuzzy/__init__.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/fuzzy/_extract_json.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/fuzzy/_fuzzy_json.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/fuzzy/_string_similarity.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/fuzzy/_to_dict.py +0 -0
- {krons-0.1.0/src/kronos → krons-0.1.1/src/krons}/utils/sql/__init__.py +0 -0
- {krons-0.1.0 → krons-0.1.1}/tests/__init__.py +0 -0
- {krons-0.1.0 → krons-0.1.1}/tests/core/__init__.py +0 -0
- {krons-0.1.0 → krons-0.1.1}/tests/enforcement/__init__.py +0 -0
- {krons-0.1.0 → krons-0.1.1}/tests/operations/__init__.py +0 -0
- {krons-0.1.0 → krons-0.1.1}/tests/rules/__init__.py +0 -0
- {krons-0.1.0 → krons-0.1.1}/tests/services/__init__.py +0 -0
- {krons-0.1.0 → krons-0.1.1}/tests/services/utilities/__init__.py +0 -0
- {krons-0.1.0 → krons-0.1.1}/tests/session/__init__.py +0 -0
- {krons-0.1.0 → krons-0.1.1}/tests/specs/__init__.py +0 -0
- {krons-0.1.0 → krons-0.1.1}/tests/types/__init__.py +0 -0
- {krons-0.1.0 → krons-0.1.1}/tests/types/spec_adapters/__init__.py +0 -0
- {krons-0.1.0 → krons-0.1.1}/tests/utils/__init__.py +0 -0
- {krons-0.1.0 → krons-0.1.1}/tests/utils/concurrency/__init__.py +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# krons - Spec-Based Composable Framework
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
**
|
|
5
|
+
**krons** is a Python framework for building spec-based, composable systems. It provides:
|
|
6
6
|
|
|
7
7
|
- **Spec/Operable**: Type-safe field definitions with validation, defaults, and DB metadata
|
|
8
8
|
- **Node**: Polymorphic content containers with DB serialization
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
## Architecture
|
|
13
13
|
|
|
14
14
|
```
|
|
15
|
-
|
|
15
|
+
krons/
|
|
16
16
|
├── core/ # Foundation: Element, Node, Event, Flow, Graph, Pile
|
|
17
17
|
├── specs/ # Spec definitions, Operable composition, adapters
|
|
18
18
|
│ ├── catalog/ # Pre-built specs (Content, Audit, Common, Enforcement)
|
|
@@ -32,8 +32,8 @@ kronos/
|
|
|
32
32
|
**Spec** defines a single field with type, name, default, validation, and DB metadata:
|
|
33
33
|
|
|
34
34
|
```python
|
|
35
|
-
from
|
|
36
|
-
from
|
|
35
|
+
from krons.specs import Spec, Operable
|
|
36
|
+
from krons.types.db_types import FK, VectorMeta
|
|
37
37
|
|
|
38
38
|
# Basic specs
|
|
39
39
|
name_spec = Spec(str, name="name")
|
|
@@ -66,7 +66,7 @@ specs_list = operable.get_specs()
|
|
|
66
66
|
Pre-built specs use BaseModel for field definitions:
|
|
67
67
|
|
|
68
68
|
```python
|
|
69
|
-
from
|
|
69
|
+
from krons.specs.catalog import ContentSpecs, AuditSpecs, CommonSpecs
|
|
70
70
|
|
|
71
71
|
# Get specs with customization
|
|
72
72
|
content_specs = ContentSpecs.get_specs(dim=1536) # With vector dimension
|
|
@@ -95,8 +95,8 @@ class MySpecs(BaseModel):
|
|
|
95
95
|
**Node** stores polymorphic content with DB serialization:
|
|
96
96
|
|
|
97
97
|
```python
|
|
98
|
-
from
|
|
99
|
-
from
|
|
98
|
+
from krons.core import Node
|
|
99
|
+
from krons.core.node import create_node, NodeConfig
|
|
100
100
|
|
|
101
101
|
# Basic usage
|
|
102
102
|
node = Node(content={"key": "value"})
|
|
@@ -129,7 +129,7 @@ restored = JobNode.from_dict(db_data, from_row=True) # Reconstructs content
|
|
|
129
129
|
**iModel** - Unified service interface with rate limiting:
|
|
130
130
|
|
|
131
131
|
```python
|
|
132
|
-
from
|
|
132
|
+
from krons.services import Endpoint, EndpointConfig, iModel
|
|
133
133
|
|
|
134
134
|
config = EndpointConfig(
|
|
135
135
|
name="gpt-4",
|
|
@@ -147,7 +147,7 @@ response = await model.invoke({"messages": [...]})
|
|
|
147
147
|
**KronService** - Action handlers with policy evaluation:
|
|
148
148
|
|
|
149
149
|
```python
|
|
150
|
-
from
|
|
150
|
+
from krons.enforcement import KronService, KronConfig, action, RequestContext
|
|
151
151
|
|
|
152
152
|
class MyService(KronService):
|
|
153
153
|
@property
|
|
@@ -167,7 +167,7 @@ result = await service.call("user.create", {"name": "John"}, RequestContext(name
|
|
|
167
167
|
Runtime-checkable protocols with signature validation:
|
|
168
168
|
|
|
169
169
|
```python
|
|
170
|
-
from
|
|
170
|
+
from krons.protocols import implements, Serializable, SignatureMismatchError
|
|
171
171
|
|
|
172
172
|
@implements(Serializable, signature_check="error") # "error", "warn", "skip"
|
|
173
173
|
class MyClass:
|
|
@@ -180,7 +180,7 @@ class MyClass:
|
|
|
180
180
|
Foreign keys and vector embeddings for SQL DDL:
|
|
181
181
|
|
|
182
182
|
```python
|
|
183
|
-
from
|
|
183
|
+
from krons.types.db_types import FK, Vector, FKMeta, VectorMeta, extract_kron_db_meta
|
|
184
184
|
|
|
185
185
|
# In type annotations
|
|
186
186
|
class Post(BaseModel):
|
|
@@ -235,11 +235,11 @@ class MockPolicyEngine:
|
|
|
235
235
|
1. **Circular imports in catalog**: Use direct imports from submodules:
|
|
236
236
|
```python
|
|
237
237
|
# Wrong
|
|
238
|
-
from
|
|
238
|
+
from krons.specs import Operable, Spec
|
|
239
239
|
|
|
240
240
|
# Right (in catalog files)
|
|
241
|
-
from
|
|
242
|
-
from
|
|
241
|
+
from krons.specs.operable import Operable
|
|
242
|
+
from krons.specs.spec import Spec
|
|
243
243
|
```
|
|
244
244
|
|
|
245
245
|
2. **PolicyEngine/PolicyResolver are Protocols**: Can't instantiate directly, create mock classes.
|
|
@@ -254,13 +254,13 @@ class MockPolicyEngine:
|
|
|
254
254
|
## Running Tests
|
|
255
255
|
|
|
256
256
|
```bash
|
|
257
|
-
cd libs/
|
|
257
|
+
cd libs/krons
|
|
258
258
|
|
|
259
259
|
# All tests
|
|
260
260
|
uv run pytest tests/ -q
|
|
261
261
|
|
|
262
262
|
# With coverage
|
|
263
|
-
uv run pytest tests/ --cov=
|
|
263
|
+
uv run pytest tests/ --cov=krons --cov-report=term-missing
|
|
264
264
|
|
|
265
265
|
# Specific module
|
|
266
266
|
uv run pytest tests/specs/test_catalog.py -v
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: krons
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Spec-based composable framework for building type-safe systems
|
|
5
|
-
Project-URL: Homepage, https://github.com/khive-ai/
|
|
6
|
-
Project-URL: Repository, https://github.com/khive-ai/
|
|
7
|
-
Project-URL: Issues, https://github.com/khive-ai/
|
|
5
|
+
Project-URL: Homepage, https://github.com/khive-ai/krons
|
|
6
|
+
Project-URL: Repository, https://github.com/khive-ai/krons
|
|
7
|
+
Project-URL: Issues, https://github.com/khive-ai/krons/issues
|
|
8
8
|
Author-email: HaiyangLi <quantocean.li@gmail.com>
|
|
9
9
|
License-Expression: Apache-2.0
|
|
10
10
|
License-File: LICENSE
|
|
@@ -46,7 +46,7 @@ pip install krons
|
|
|
46
46
|
## Quick Start
|
|
47
47
|
|
|
48
48
|
```python
|
|
49
|
-
from
|
|
49
|
+
from krons.specs import Spec, Operable
|
|
50
50
|
|
|
51
51
|
# Define specs
|
|
52
52
|
name_spec = Spec(str, name="name")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "krons"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.1"
|
|
4
4
|
description = "Spec-based composable framework for building type-safe systems"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.11"
|
|
@@ -29,9 +29,9 @@ dependencies = [
|
|
|
29
29
|
]
|
|
30
30
|
|
|
31
31
|
[project.urls]
|
|
32
|
-
Homepage = "https://github.com/khive-ai/
|
|
33
|
-
Repository = "https://github.com/khive-ai/
|
|
34
|
-
Issues = "https://github.com/khive-ai/
|
|
32
|
+
Homepage = "https://github.com/khive-ai/krons"
|
|
33
|
+
Repository = "https://github.com/khive-ai/krons"
|
|
34
|
+
Issues = "https://github.com/khive-ai/krons/issues"
|
|
35
35
|
|
|
36
36
|
[dependency-groups]
|
|
37
37
|
dev = [
|
|
@@ -48,8 +48,8 @@ requires = ["hatchling"]
|
|
|
48
48
|
build-backend = "hatchling.build"
|
|
49
49
|
|
|
50
50
|
[tool.hatch.build.targets.wheel]
|
|
51
|
-
packages = ["src/
|
|
52
|
-
artifacts = ["src/
|
|
51
|
+
packages = ["src/krons"]
|
|
52
|
+
artifacts = ["src/krons/py.typed"]
|
|
53
53
|
|
|
54
54
|
[tool.pytest.ini_options]
|
|
55
55
|
asyncio_mode = "strict"
|
|
@@ -10,46 +10,46 @@ from typing import TYPE_CHECKING
|
|
|
10
10
|
# Lazy import mapping
|
|
11
11
|
_LAZY_IMPORTS: dict[str, tuple[str, str]] = {
|
|
12
12
|
# broadcaster
|
|
13
|
-
"Broadcaster": ("
|
|
13
|
+
"Broadcaster": ("krons.core.broadcaster", "Broadcaster"),
|
|
14
14
|
# element
|
|
15
|
-
"Element": ("
|
|
15
|
+
"Element": ("krons.core.element", "Element"),
|
|
16
16
|
# event
|
|
17
|
-
"Event": ("
|
|
18
|
-
"EventStatus": ("
|
|
19
|
-
"Execution": ("
|
|
17
|
+
"Event": ("krons.core.event", "Event"),
|
|
18
|
+
"EventStatus": ("krons.core.event", "EventStatus"),
|
|
19
|
+
"Execution": ("krons.core.event", "Execution"),
|
|
20
20
|
# eventbus
|
|
21
|
-
"EventBus": ("
|
|
22
|
-
"Handler": ("
|
|
21
|
+
"EventBus": ("krons.core.eventbus", "EventBus"),
|
|
22
|
+
"Handler": ("krons.core.eventbus", "Handler"),
|
|
23
23
|
# flow
|
|
24
|
-
"Flow": ("
|
|
24
|
+
"Flow": ("krons.core.flow", "Flow"),
|
|
25
25
|
# graph
|
|
26
|
-
"Edge": ("
|
|
27
|
-
"EdgeCondition": ("
|
|
28
|
-
"Graph": ("
|
|
26
|
+
"Edge": ("krons.core.graph", "Edge"),
|
|
27
|
+
"EdgeCondition": ("krons.core.graph", "EdgeCondition"),
|
|
28
|
+
"Graph": ("krons.core.graph", "Graph"),
|
|
29
29
|
# node
|
|
30
|
-
"DEFAULT_NODE_CONFIG": ("
|
|
31
|
-
"NODE_REGISTRY": ("
|
|
32
|
-
"PERSISTABLE_NODE_REGISTRY": ("
|
|
33
|
-
"Node": ("
|
|
34
|
-
"NodeConfig": ("
|
|
35
|
-
"create_node": ("
|
|
36
|
-
"generate_ddl": ("
|
|
30
|
+
"DEFAULT_NODE_CONFIG": ("krons.core.node", "DEFAULT_NODE_CONFIG"),
|
|
31
|
+
"NODE_REGISTRY": ("krons.core.node", "NODE_REGISTRY"),
|
|
32
|
+
"PERSISTABLE_NODE_REGISTRY": ("krons.core.node", "PERSISTABLE_NODE_REGISTRY"),
|
|
33
|
+
"Node": ("krons.core.node", "Node"),
|
|
34
|
+
"NodeConfig": ("krons.core.node", "NodeConfig"),
|
|
35
|
+
"create_node": ("krons.core.node", "create_node"),
|
|
36
|
+
"generate_ddl": ("krons.core.node", "generate_ddl"),
|
|
37
37
|
# phrase
|
|
38
|
-
"PHRASE_REGISTRY": ("
|
|
39
|
-
"Phrase": ("
|
|
40
|
-
"PhraseConfig": ("
|
|
41
|
-
"PhraseError": ("
|
|
42
|
-
"RequirementNotMet": ("
|
|
43
|
-
"create_phrase": ("
|
|
44
|
-
"get_phrase": ("
|
|
45
|
-
"list_phrases": ("
|
|
38
|
+
"PHRASE_REGISTRY": ("krons.core.phrase", "PHRASE_REGISTRY"),
|
|
39
|
+
"Phrase": ("krons.core.phrase", "Phrase"),
|
|
40
|
+
"PhraseConfig": ("krons.core.phrase", "PhraseConfig"),
|
|
41
|
+
"PhraseError": ("krons.core.phrase", "PhraseError"),
|
|
42
|
+
"RequirementNotMet": ("krons.core.phrase", "RequirementNotMet"),
|
|
43
|
+
"create_phrase": ("krons.core.phrase", "create_phrase"),
|
|
44
|
+
"get_phrase": ("krons.core.phrase", "get_phrase"),
|
|
45
|
+
"list_phrases": ("krons.core.phrase", "list_phrases"),
|
|
46
46
|
# pile
|
|
47
|
-
"Pile": ("
|
|
47
|
+
"Pile": ("krons.core.pile", "Pile"),
|
|
48
48
|
# processor
|
|
49
|
-
"Executor": ("
|
|
50
|
-
"Processor": ("
|
|
49
|
+
"Executor": ("krons.core.processor", "Executor"),
|
|
50
|
+
"Processor": ("krons.core.processor", "Processor"),
|
|
51
51
|
# progression
|
|
52
|
-
"Progression": ("
|
|
52
|
+
"Progression": ("krons.core.progression", "Progression"),
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
_LOADED: dict[str, object] = {}
|
|
@@ -69,7 +69,7 @@ def __getattr__(name: str) -> object:
|
|
|
69
69
|
_LOADED[name] = value
|
|
70
70
|
return value
|
|
71
71
|
|
|
72
|
-
raise AttributeError(f"module '
|
|
72
|
+
raise AttributeError(f"module 'krons.core' has no attribute {name!r}")
|
|
73
73
|
|
|
74
74
|
|
|
75
75
|
def __dir__() -> list[str]:
|
|
@@ -11,15 +11,15 @@ from uuid import UUID, uuid4
|
|
|
11
11
|
import orjson
|
|
12
12
|
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
|
13
13
|
|
|
14
|
-
from
|
|
14
|
+
from krons.protocols import (
|
|
15
15
|
Deserializable,
|
|
16
16
|
Hashable,
|
|
17
17
|
Observable,
|
|
18
18
|
Serializable,
|
|
19
19
|
implements,
|
|
20
20
|
)
|
|
21
|
-
from
|
|
22
|
-
from
|
|
21
|
+
from krons.types import MaybeSentinel, Unset, UnsetType, is_sentinel, is_unset
|
|
22
|
+
from krons.utils import (
|
|
23
23
|
coerce_created_at,
|
|
24
24
|
json_dump,
|
|
25
25
|
load_type_from_string,
|
|
@@ -11,10 +11,10 @@ from typing import Any, final
|
|
|
11
11
|
import orjson
|
|
12
12
|
from pydantic import Field, field_serializer, field_validator
|
|
13
13
|
|
|
14
|
-
from
|
|
15
|
-
from
|
|
16
|
-
from
|
|
17
|
-
from
|
|
14
|
+
from krons.errors import KronError, KronTimeoutError
|
|
15
|
+
from krons.protocols import Invocable, Serializable, implements
|
|
16
|
+
from krons.types import Enum, MaybeSentinel, MaybeUnset, Unset, is_sentinel, is_unset
|
|
17
|
+
from krons.utils import async_synchronized, concurrency, json_dumpb
|
|
18
18
|
|
|
19
19
|
from .element import LN_ELEMENT_FIELDS, Element
|
|
20
20
|
|
|
@@ -9,10 +9,10 @@ from uuid import UUID
|
|
|
9
9
|
|
|
10
10
|
from pydantic import Field, PrivateAttr, field_validator, model_validator
|
|
11
11
|
|
|
12
|
-
from
|
|
13
|
-
from
|
|
14
|
-
from
|
|
15
|
-
from
|
|
12
|
+
from krons.errors import ExistsError, NotFoundError
|
|
13
|
+
from krons.protocols import Serializable, implements
|
|
14
|
+
from krons.types import Unset, UnsetType
|
|
15
|
+
from krons.utils import extract_types, synchronized
|
|
16
16
|
|
|
17
17
|
from .element import Element
|
|
18
18
|
from .pile import Pile
|
|
@@ -11,10 +11,10 @@ from uuid import UUID
|
|
|
11
11
|
from pydantic import Field, PrivateAttr, field_validator, model_validator
|
|
12
12
|
from typing_extensions import override
|
|
13
13
|
|
|
14
|
-
from
|
|
15
|
-
from
|
|
16
|
-
from
|
|
17
|
-
from
|
|
14
|
+
from krons.errors import NotFoundError
|
|
15
|
+
from krons.protocols import Containable, Deserializable, Serializable, implements
|
|
16
|
+
from krons.types import Unset, UnsetType, is_unset
|
|
17
|
+
from krons.utils import synchronized
|
|
18
18
|
|
|
19
19
|
from .element import Element
|
|
20
20
|
from .node import Node
|
|
@@ -15,8 +15,8 @@ from uuid import UUID
|
|
|
15
15
|
|
|
16
16
|
from pydantic import BaseModel, field_serializer, field_validator
|
|
17
17
|
|
|
18
|
-
from
|
|
19
|
-
from
|
|
18
|
+
from krons.protocols import Deserializable, Serializable, implements
|
|
19
|
+
from krons.types import (
|
|
20
20
|
ModelConfig,
|
|
21
21
|
Params,
|
|
22
22
|
Unset,
|
|
@@ -25,8 +25,8 @@ from kronos.types import (
|
|
|
25
25
|
is_unset,
|
|
26
26
|
not_sentinel,
|
|
27
27
|
)
|
|
28
|
-
from
|
|
29
|
-
from
|
|
28
|
+
from krons.types.db_types import VectorMeta, extract_kron_db_meta
|
|
29
|
+
from krons.utils import compute_hash, json_dump, now_utc
|
|
30
30
|
|
|
31
31
|
from .element import Element
|
|
32
32
|
|
|
@@ -258,7 +258,7 @@ class Node(Element):
|
|
|
258
258
|
f"or Element.metadata for simple key-value pairs."
|
|
259
259
|
)
|
|
260
260
|
|
|
261
|
-
# Polymorphic: restore type from
|
|
261
|
+
# Polymorphic: restore type from krons_class in metadata
|
|
262
262
|
if isinstance(value, dict) and "metadata" in value:
|
|
263
263
|
metadata = value.get("metadata", {})
|
|
264
264
|
kron_class = metadata.get("kron_class")
|
|
@@ -503,7 +503,7 @@ class Node(Element):
|
|
|
503
503
|
Computed integrity_hash, or None if integrity_hashing disabled
|
|
504
504
|
|
|
505
505
|
"""
|
|
506
|
-
from
|
|
506
|
+
from krons.utils import compute_chain_hash
|
|
507
507
|
|
|
508
508
|
config = self.get_config()
|
|
509
509
|
if not config.integrity_hashing:
|
|
@@ -704,8 +704,8 @@ def create_node(
|
|
|
704
704
|
>>> Job = create_node("Job", embedding_enabled=True, embedding_dim=1536)
|
|
705
705
|
|
|
706
706
|
"""
|
|
707
|
-
from
|
|
708
|
-
from
|
|
707
|
+
from krons.specs.catalog import AuditSpecs, ContentSpecs
|
|
708
|
+
from krons.specs.operable import Operable
|
|
709
709
|
|
|
710
710
|
# Resolve embedding dimension
|
|
711
711
|
resolved_embedding_dim: int | UnsetType = Unset
|
|
@@ -835,8 +835,8 @@ def generate_ddl(
|
|
|
835
835
|
ValueError: If node_cls has no table_name configured
|
|
836
836
|
|
|
837
837
|
"""
|
|
838
|
-
from
|
|
839
|
-
from
|
|
838
|
+
from krons.specs.catalog import AuditSpecs, ContentSpecs
|
|
839
|
+
from krons.specs.operable import Operable
|
|
840
840
|
|
|
841
841
|
config = node_cls.get_config()
|
|
842
842
|
if not config.is_persisted:
|
|
@@ -855,7 +855,7 @@ def generate_ddl(
|
|
|
855
855
|
|
|
856
856
|
# Flatten content: extract fields from BaseModel instead of generic JSONB
|
|
857
857
|
if config.flatten_content and content_type is not None:
|
|
858
|
-
from
|
|
858
|
+
from krons.specs.adapters.pydantic_adapter import PydanticSpecAdapter
|
|
859
859
|
|
|
860
860
|
if isinstance(content_type, type) and issubclass(content_type, BaseModel):
|
|
861
861
|
all_specs.extend(PydanticSpecAdapter.extract_specs(content_type))
|
|
@@ -12,11 +12,11 @@ from uuid import UUID
|
|
|
12
12
|
from pydantic import Field, PrivateAttr, field_serializer, field_validator
|
|
13
13
|
from typing_extensions import override
|
|
14
14
|
|
|
15
|
-
from
|
|
16
|
-
from
|
|
17
|
-
from
|
|
18
|
-
from
|
|
19
|
-
from
|
|
15
|
+
from krons.errors import ExistsError, NotFoundError
|
|
16
|
+
from krons.protocols import Containable, Deserializable, Serializable, implements
|
|
17
|
+
from krons.types import Unset, UnsetType, is_unset
|
|
18
|
+
from krons.utils import extract_types, load_type_from_string, synchronized
|
|
19
|
+
from krons.utils.concurrency import Lock as AsyncLock
|
|
20
20
|
|
|
21
21
|
from .element import Element
|
|
22
22
|
from .progression import Progression
|
|
@@ -6,8 +6,8 @@ from __future__ import annotations
|
|
|
6
6
|
import math
|
|
7
7
|
from typing import TYPE_CHECKING, Any, ClassVar, Self
|
|
8
8
|
|
|
9
|
-
from
|
|
10
|
-
from
|
|
9
|
+
from krons.errors import ConfigurationError, NotFoundError, QueueFullError
|
|
10
|
+
from krons.utils import concurrency
|
|
11
11
|
|
|
12
12
|
from .event import Event, EventStatus
|
|
13
13
|
from .flow import Flow
|
|
@@ -9,8 +9,8 @@ from uuid import UUID
|
|
|
9
9
|
|
|
10
10
|
from pydantic import Field, PrivateAttr, field_validator
|
|
11
11
|
|
|
12
|
-
from
|
|
13
|
-
from
|
|
12
|
+
from krons.errors import NotFoundError
|
|
13
|
+
from krons.protocols import Containable, implements
|
|
14
14
|
|
|
15
15
|
from .element import Element
|
|
16
16
|
|
|
@@ -14,7 +14,7 @@ Mental model:
|
|
|
14
14
|
Policy = external evaluation protocol (implementations in domain libs)
|
|
15
15
|
|
|
16
16
|
Usage:
|
|
17
|
-
from
|
|
17
|
+
from krons.enforcement import Rule, Validator, RuleRegistry
|
|
18
18
|
|
|
19
19
|
# Register rules
|
|
20
20
|
registry = RuleRegistry()
|
|
@@ -11,11 +11,11 @@ from datetime import datetime
|
|
|
11
11
|
from typing import TYPE_CHECKING, Any, Protocol
|
|
12
12
|
from uuid import UUID, uuid4
|
|
13
13
|
|
|
14
|
-
from
|
|
15
|
-
from
|
|
14
|
+
from krons.types.base import DataClass
|
|
15
|
+
from krons.types.identity import ID
|
|
16
16
|
|
|
17
17
|
if TYPE_CHECKING:
|
|
18
|
-
from
|
|
18
|
+
from krons.session import Branch, Session
|
|
19
19
|
|
|
20
20
|
__all__ = ("QueryFn", "RequestContext")
|
|
21
21
|
|
|
@@ -13,9 +13,9 @@ from collections.abc import Sequence
|
|
|
13
13
|
from dataclasses import dataclass, field
|
|
14
14
|
from typing import Any, Protocol, runtime_checkable
|
|
15
15
|
|
|
16
|
-
from
|
|
17
|
-
from
|
|
18
|
-
from
|
|
16
|
+
from krons.enforcement.context import RequestContext
|
|
17
|
+
from krons.specs.catalog._enforcement import EnforcementLevel
|
|
18
|
+
from krons.types.base import DataClass
|
|
19
19
|
|
|
20
20
|
__all__ = (
|
|
21
21
|
"EnforcementLevel",
|
|
@@ -8,8 +8,8 @@ from dataclasses import dataclass, field
|
|
|
8
8
|
from enum import IntEnum, auto
|
|
9
9
|
from typing import Any
|
|
10
10
|
|
|
11
|
-
from
|
|
12
|
-
from
|
|
11
|
+
from krons.errors import ValidationError
|
|
12
|
+
from krons.types import Params
|
|
13
13
|
|
|
14
14
|
__all__ = ("Rule", "RuleParams", "RuleQualifier", "ValidationError")
|
|
15
15
|
|
|
@@ -12,7 +12,7 @@ from typing import Any
|
|
|
12
12
|
|
|
13
13
|
from pydantic import Field, PrivateAttr
|
|
14
14
|
|
|
15
|
-
from
|
|
15
|
+
from krons.services import ServiceBackend, ServiceConfig
|
|
16
16
|
|
|
17
17
|
from .context import RequestContext
|
|
18
18
|
from .policy import EnforcementLevel, PolicyEngine, PolicyResolver
|
|
@@ -7,14 +7,14 @@ from collections import deque
|
|
|
7
7
|
from datetime import datetime
|
|
8
8
|
from typing import TYPE_CHECKING, Any, ClassVar
|
|
9
9
|
|
|
10
|
-
from
|
|
11
|
-
from
|
|
10
|
+
from krons.types import is_sentinel
|
|
11
|
+
from krons.utils.concurrency import is_coro_func
|
|
12
12
|
|
|
13
13
|
from .registry import RuleRegistry, get_default_registry
|
|
14
14
|
from .rule import Rule, ValidationError
|
|
15
15
|
|
|
16
16
|
if TYPE_CHECKING:
|
|
17
|
-
from
|
|
17
|
+
from krons.specs import Operable, Spec
|
|
18
18
|
|
|
19
19
|
__all__ = ("Validator",)
|
|
20
20
|
|
|
@@ -12,14 +12,14 @@ from __future__ import annotations
|
|
|
12
12
|
from typing import TYPE_CHECKING, Any
|
|
13
13
|
from uuid import UUID
|
|
14
14
|
|
|
15
|
-
from
|
|
16
|
-
from
|
|
17
|
-
from
|
|
15
|
+
from krons.core import Edge, Graph
|
|
16
|
+
from krons.types import Undefined, UndefinedType, is_sentinel, not_sentinel
|
|
17
|
+
from krons.utils._utils import to_uuid
|
|
18
18
|
|
|
19
19
|
from .node import Operation
|
|
20
20
|
|
|
21
21
|
if TYPE_CHECKING:
|
|
22
|
-
from
|
|
22
|
+
from krons.session import Branch
|
|
23
23
|
|
|
24
24
|
__all__ = ("Builder", "OperationGraphBuilder")
|
|
25
25
|
|
|
@@ -15,15 +15,15 @@ from dataclasses import dataclass
|
|
|
15
15
|
from typing import TYPE_CHECKING, Any
|
|
16
16
|
from uuid import UUID
|
|
17
17
|
|
|
18
|
-
from
|
|
19
|
-
from
|
|
20
|
-
from
|
|
21
|
-
from
|
|
18
|
+
from krons.core import EventStatus, Graph
|
|
19
|
+
from krons.types import Undefined, UndefinedType, is_sentinel
|
|
20
|
+
from krons.utils import concurrency
|
|
21
|
+
from krons.utils.concurrency import CapacityLimiter, CompletionStream
|
|
22
22
|
|
|
23
23
|
from .node import Operation
|
|
24
24
|
|
|
25
25
|
if TYPE_CHECKING:
|
|
26
|
-
from
|
|
26
|
+
from krons.session import Branch, Session
|
|
27
27
|
|
|
28
28
|
logger = logging.getLogger(__name__)
|
|
29
29
|
|
|
@@ -6,11 +6,11 @@ from typing import TYPE_CHECKING, Any
|
|
|
6
6
|
|
|
7
7
|
from pydantic import Field, PrivateAttr
|
|
8
8
|
|
|
9
|
-
from
|
|
10
|
-
from
|
|
9
|
+
from krons.core import Event, Node
|
|
10
|
+
from krons.types import Undefined, UndefinedType, is_sentinel
|
|
11
11
|
|
|
12
12
|
if TYPE_CHECKING:
|
|
13
|
-
from
|
|
13
|
+
from krons.session import Branch, Session
|
|
14
14
|
|
|
15
15
|
__all__ = ("Operation", "create_operation")
|
|
16
16
|
|
|
@@ -18,18 +18,18 @@ from typing import TYPE_CHECKING
|
|
|
18
18
|
|
|
19
19
|
# Lazy import mapping
|
|
20
20
|
_LAZY_IMPORTS: dict[str, tuple[str, str]] = {
|
|
21
|
-
"Calling": ("
|
|
22
|
-
"NormalizedResponse": ("
|
|
23
|
-
"ServiceBackend": ("
|
|
24
|
-
"ServiceConfig": ("
|
|
25
|
-
"ServiceRegistry": ("
|
|
26
|
-
"iModel": ("
|
|
27
|
-
"Endpoint": ("
|
|
28
|
-
"EndpointConfig": ("
|
|
29
|
-
"APICalling": ("
|
|
30
|
-
"HookRegistry": ("
|
|
31
|
-
"HookEvent": ("
|
|
32
|
-
"HookPhase": ("
|
|
21
|
+
"Calling": ("krons.services.backend", "Calling"),
|
|
22
|
+
"NormalizedResponse": ("krons.services.backend", "NormalizedResponse"),
|
|
23
|
+
"ServiceBackend": ("krons.services.backend", "ServiceBackend"),
|
|
24
|
+
"ServiceConfig": ("krons.services.backend", "ServiceConfig"),
|
|
25
|
+
"ServiceRegistry": ("krons.services.registry", "ServiceRegistry"),
|
|
26
|
+
"iModel": ("krons.services.imodel", "iModel"),
|
|
27
|
+
"Endpoint": ("krons.services.endpoint", "Endpoint"),
|
|
28
|
+
"EndpointConfig": ("krons.services.endpoint", "EndpointConfig"),
|
|
29
|
+
"APICalling": ("krons.services.endpoint", "APICalling"),
|
|
30
|
+
"HookRegistry": ("krons.services.hook", "HookRegistry"),
|
|
31
|
+
"HookEvent": ("krons.services.hook", "HookEvent"),
|
|
32
|
+
"HookPhase": ("krons.services.hook", "HookPhase"),
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
_LOADED: dict[str, object] = {}
|
|
@@ -49,7 +49,7 @@ def __getattr__(name: str) -> object:
|
|
|
49
49
|
_LOADED[name] = value
|
|
50
50
|
return value
|
|
51
51
|
|
|
52
|
-
raise AttributeError(f"module '
|
|
52
|
+
raise AttributeError(f"module 'krons.services' has no attribute {name!r}")
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
def __dir__() -> list[str]:
|