tigrbl-runtime 0.4.4.dev8__py3-none-any.whl → 0.4.5.dev4__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.
@@ -16,11 +16,7 @@ from typing import (
16
16
  runtime_checkable,
17
17
  )
18
18
 
19
- try:
20
- from sqlalchemy.ext.asyncio import AsyncSession
21
- from sqlalchemy.orm import Session
22
- except Exception: # pragma: no cover - optional ORM dependency for runtime typing
23
- AsyncSession = Session = Any # type: ignore[assignment]
19
+ AsyncSession = Session = Any # type: ignore[assignment]
24
20
 
25
21
  from tigrbl_atoms.types import BaseCtx
26
22
  from tigrbl_base._base import AttrDict
@@ -0,0 +1,200 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping as ABCMapping
4
+ from typing import Any, Mapping
5
+
6
+ from .hot_state import (
7
+ HotCtx,
8
+ _ensure_hot_assembled_values_view,
9
+ _ensure_hot_in_values_view,
10
+ _ensure_hot_virtual_in_view,
11
+ _LAZY_MISSING,
12
+ )
13
+
14
+
15
+ def _coerce_optional_dict(value: Any) -> dict[str, Any] | None:
16
+ if isinstance(value, dict):
17
+ return value
18
+ if isinstance(value, ABCMapping):
19
+ return dict(value)
20
+ return None
21
+
22
+
23
+ def _namespace_lazy_value(kind: str, hot: HotCtx, key: str) -> Any:
24
+ if kind == "route":
25
+ if key == "selector":
26
+ value = hot.route_selector
27
+ return value if value else _LAZY_MISSING
28
+ if key == "protocol":
29
+ value = hot.route_protocol
30
+ return value if value else _LAZY_MISSING
31
+ if key == "program_id":
32
+ value = (
33
+ hot.route_program_id if hot.route_program_id >= 0 else hot.program_id
34
+ )
35
+ return value if value >= 0 else _LAZY_MISSING
36
+ if key == "opmeta_index":
37
+ value = (
38
+ hot.route_opmeta_index
39
+ if hot.route_opmeta_index >= 0
40
+ else hot.route_program_id
41
+ )
42
+ return value if value >= 0 else _LAZY_MISSING
43
+ if key == "method_not_allowed":
44
+ return True if hot.route_method_not_allowed else _LAZY_MISSING
45
+ if key == "short_circuit":
46
+ return True if hot.route_short_circuit else _LAZY_MISSING
47
+ if key == "payload":
48
+ if hot.route_payload is not None:
49
+ return hot.route_payload
50
+ value = _ensure_hot_in_values_view(hot)
51
+ return value if value is not None else _LAZY_MISSING
52
+ if key == "path_params":
53
+ value = hot.route_path_params or hot.path_params
54
+ return value if value is not None else _LAZY_MISSING
55
+ if key == "rpc_envelope":
56
+ value = hot.route_rpc_envelope or hot.dispatch_rpc_envelope
57
+ return value if value is not None else _LAZY_MISSING
58
+ return _LAZY_MISSING
59
+ if kind == "dispatch":
60
+ if key == "binding_protocol":
61
+ value = hot.dispatch_binding_protocol
62
+ return value if value else _LAZY_MISSING
63
+ if key == "binding_selector":
64
+ value = hot.dispatch_binding_selector
65
+ return value if value else _LAZY_MISSING
66
+ if key == "channel_protocol":
67
+ value = hot.dispatch_channel_protocol
68
+ return value if value else _LAZY_MISSING
69
+ if key == "channel_selector":
70
+ value = hot.dispatch_channel_selector
71
+ return value if value else _LAZY_MISSING
72
+ if key in {"normalized_input", "parsed_payload"}:
73
+ value = _ensure_hot_in_values_view(hot)
74
+ return value if value is not None else _LAZY_MISSING
75
+ if key == "rpc":
76
+ value = hot.dispatch_rpc_envelope or hot.route_rpc_envelope
77
+ return value if value is not None else _LAZY_MISSING
78
+ if key == "rpc_method":
79
+ value = hot.dispatch_rpc_method
80
+ return value if value is not None else _LAZY_MISSING
81
+ return _LAZY_MISSING
82
+ if kind == "egress":
83
+ if key == "transport_response":
84
+ value = hot.egress_transport_response
85
+ return value if value is not None else _LAZY_MISSING
86
+ if key == "sent":
87
+ return True if hot.egress_sent else _LAZY_MISSING
88
+ return _LAZY_MISSING
89
+ return _LAZY_MISSING
90
+
91
+
92
+ def _sync_hot_namespace_value(kind: str, hot: HotCtx, key: str, value: Any) -> None:
93
+ if kind == "route":
94
+ if key == "selector" and isinstance(value, str):
95
+ hot.route_selector = value
96
+ elif key == "protocol" and isinstance(value, str):
97
+ hot.route_protocol = value
98
+ elif key == "program_id" and isinstance(value, int):
99
+ hot.route_program_id = value
100
+ hot.program_id = value
101
+ elif key == "opmeta_index" and isinstance(value, int):
102
+ hot.route_opmeta_index = value
103
+ if hot.route_program_id < 0:
104
+ hot.route_program_id = value
105
+ if hot.program_id < 0:
106
+ hot.program_id = value
107
+ elif key == "method_not_allowed":
108
+ hot.route_method_not_allowed = bool(value)
109
+ elif key == "short_circuit":
110
+ hot.route_short_circuit = bool(value)
111
+ elif key == "payload":
112
+ hot.route_payload = _coerce_optional_dict(value)
113
+ elif key == "path_params":
114
+ path_params = _coerce_optional_dict(value)
115
+ hot.route_path_params = path_params
116
+ hot.path_params = path_params
117
+ elif key == "rpc_envelope":
118
+ envelope = _coerce_optional_dict(value)
119
+ hot.route_rpc_envelope = envelope
120
+ if envelope is not None:
121
+ hot.dispatch_jsonrpc_request_id = envelope.get("id")
122
+ method = envelope.get("method")
123
+ hot.dispatch_rpc_method = method if isinstance(method, str) else None
124
+ elif kind == "dispatch":
125
+ if key == "binding_protocol" and isinstance(value, str):
126
+ hot.dispatch_binding_protocol = value
127
+ elif key == "binding_selector" and isinstance(value, str):
128
+ hot.dispatch_binding_selector = value
129
+ elif key == "channel_protocol" and isinstance(value, str):
130
+ hot.dispatch_channel_protocol = value
131
+ elif key == "channel_selector" and isinstance(value, str):
132
+ hot.dispatch_channel_selector = value
133
+ elif key == "rpc":
134
+ envelope = _coerce_optional_dict(value)
135
+ hot.dispatch_rpc_envelope = envelope
136
+ if envelope is not None:
137
+ hot.dispatch_jsonrpc_request_id = envelope.get("id")
138
+ method = envelope.get("method")
139
+ hot.dispatch_rpc_method = method if isinstance(method, str) else None
140
+ elif key == "rpc_method":
141
+ hot.dispatch_rpc_method = value if isinstance(value, str) else None
142
+ elif key in {"normalized_input", "parsed_payload"}:
143
+ route_payload = _coerce_optional_dict(value)
144
+ if route_payload is not None:
145
+ hot.route_payload = route_payload
146
+ elif key == "jsonrpc_request_id":
147
+ hot.dispatch_jsonrpc_request_id = value
148
+ elif kind == "egress":
149
+ if key == "transport_response":
150
+ hot.egress_transport_response = _coerce_optional_dict(value)
151
+ elif key == "sent":
152
+ hot.egress_sent = bool(value)
153
+
154
+
155
+ def _clear_hot_namespace_value(kind: str, hot: HotCtx, key: str) -> None:
156
+ if kind == "route":
157
+ if key == "selector":
158
+ hot.route_selector = ""
159
+ elif key == "protocol":
160
+ hot.route_protocol = ""
161
+ elif key == "program_id":
162
+ hot.route_program_id = -1
163
+ elif key == "opmeta_index":
164
+ hot.route_opmeta_index = -1
165
+ elif key == "method_not_allowed":
166
+ hot.route_method_not_allowed = False
167
+ elif key == "short_circuit":
168
+ hot.route_short_circuit = False
169
+ elif key == "payload":
170
+ hot.route_payload = None
171
+ elif key == "path_params":
172
+ hot.route_path_params = None
173
+ hot.path_params = None
174
+ elif key == "rpc_envelope":
175
+ hot.route_rpc_envelope = None
176
+ hot.dispatch_jsonrpc_request_id = None
177
+ hot.dispatch_rpc_method = None
178
+ elif kind == "dispatch":
179
+ if key == "binding_protocol":
180
+ hot.dispatch_binding_protocol = ""
181
+ elif key == "binding_selector":
182
+ hot.dispatch_binding_selector = ""
183
+ elif key == "channel_protocol":
184
+ hot.dispatch_channel_protocol = ""
185
+ elif key == "channel_selector":
186
+ hot.dispatch_channel_selector = ""
187
+ elif key == "rpc":
188
+ hot.dispatch_rpc_envelope = None
189
+ hot.dispatch_jsonrpc_request_id = None
190
+ hot.dispatch_rpc_method = None
191
+ elif key == "rpc_method":
192
+ hot.dispatch_rpc_method = None
193
+ elif key == "jsonrpc_request_id":
194
+ hot.dispatch_jsonrpc_request_id = None
195
+ elif kind == "egress":
196
+ if key == "transport_response":
197
+ hot.egress_transport_response = None
198
+ elif key == "sent":
199
+ hot.egress_sent = False
200
+
@@ -10,193 +10,12 @@ from .hot_state import (
10
10
  _ensure_hot_virtual_in_view,
11
11
  _LAZY_MISSING,
12
12
  )
13
-
14
-
15
- def _coerce_optional_dict(value: Any) -> dict[str, Any] | None:
16
- if isinstance(value, dict):
17
- return value
18
- if isinstance(value, ABCMapping):
19
- return dict(value)
20
- return None
21
-
22
-
23
- def _namespace_lazy_value(kind: str, hot: HotCtx, key: str) -> Any:
24
- if kind == "route":
25
- if key == "selector":
26
- value = hot.route_selector
27
- return value if value else _LAZY_MISSING
28
- if key == "protocol":
29
- value = hot.route_protocol
30
- return value if value else _LAZY_MISSING
31
- if key == "program_id":
32
- value = (
33
- hot.route_program_id if hot.route_program_id >= 0 else hot.program_id
34
- )
35
- return value if value >= 0 else _LAZY_MISSING
36
- if key == "opmeta_index":
37
- value = (
38
- hot.route_opmeta_index
39
- if hot.route_opmeta_index >= 0
40
- else hot.route_program_id
41
- )
42
- return value if value >= 0 else _LAZY_MISSING
43
- if key == "method_not_allowed":
44
- return True if hot.route_method_not_allowed else _LAZY_MISSING
45
- if key == "short_circuit":
46
- return True if hot.route_short_circuit else _LAZY_MISSING
47
- if key == "payload":
48
- if hot.route_payload is not None:
49
- return hot.route_payload
50
- value = _ensure_hot_in_values_view(hot)
51
- return value if value is not None else _LAZY_MISSING
52
- if key == "path_params":
53
- value = hot.route_path_params or hot.path_params
54
- return value if value is not None else _LAZY_MISSING
55
- if key == "rpc_envelope":
56
- value = hot.route_rpc_envelope or hot.dispatch_rpc_envelope
57
- return value if value is not None else _LAZY_MISSING
58
- return _LAZY_MISSING
59
- if kind == "dispatch":
60
- if key == "binding_protocol":
61
- value = hot.dispatch_binding_protocol
62
- return value if value else _LAZY_MISSING
63
- if key == "binding_selector":
64
- value = hot.dispatch_binding_selector
65
- return value if value else _LAZY_MISSING
66
- if key == "channel_protocol":
67
- value = hot.dispatch_channel_protocol
68
- return value if value else _LAZY_MISSING
69
- if key == "channel_selector":
70
- value = hot.dispatch_channel_selector
71
- return value if value else _LAZY_MISSING
72
- if key in {"normalized_input", "parsed_payload"}:
73
- value = _ensure_hot_in_values_view(hot)
74
- return value if value is not None else _LAZY_MISSING
75
- if key == "rpc":
76
- value = hot.dispatch_rpc_envelope or hot.route_rpc_envelope
77
- return value if value is not None else _LAZY_MISSING
78
- if key == "rpc_method":
79
- value = hot.dispatch_rpc_method
80
- return value if value is not None else _LAZY_MISSING
81
- return _LAZY_MISSING
82
- if kind == "egress":
83
- if key == "transport_response":
84
- value = hot.egress_transport_response
85
- return value if value is not None else _LAZY_MISSING
86
- if key == "sent":
87
- return True if hot.egress_sent else _LAZY_MISSING
88
- return _LAZY_MISSING
89
- return _LAZY_MISSING
90
-
91
-
92
- def _sync_hot_namespace_value(kind: str, hot: HotCtx, key: str, value: Any) -> None:
93
- if kind == "route":
94
- if key == "selector" and isinstance(value, str):
95
- hot.route_selector = value
96
- elif key == "protocol" and isinstance(value, str):
97
- hot.route_protocol = value
98
- elif key == "program_id" and isinstance(value, int):
99
- hot.route_program_id = value
100
- hot.program_id = value
101
- elif key == "opmeta_index" and isinstance(value, int):
102
- hot.route_opmeta_index = value
103
- if hot.route_program_id < 0:
104
- hot.route_program_id = value
105
- if hot.program_id < 0:
106
- hot.program_id = value
107
- elif key == "method_not_allowed":
108
- hot.route_method_not_allowed = bool(value)
109
- elif key == "short_circuit":
110
- hot.route_short_circuit = bool(value)
111
- elif key == "payload":
112
- hot.route_payload = _coerce_optional_dict(value)
113
- elif key == "path_params":
114
- path_params = _coerce_optional_dict(value)
115
- hot.route_path_params = path_params
116
- hot.path_params = path_params
117
- elif key == "rpc_envelope":
118
- envelope = _coerce_optional_dict(value)
119
- hot.route_rpc_envelope = envelope
120
- if envelope is not None:
121
- hot.dispatch_jsonrpc_request_id = envelope.get("id")
122
- method = envelope.get("method")
123
- hot.dispatch_rpc_method = method if isinstance(method, str) else None
124
- elif kind == "dispatch":
125
- if key == "binding_protocol" and isinstance(value, str):
126
- hot.dispatch_binding_protocol = value
127
- elif key == "binding_selector" and isinstance(value, str):
128
- hot.dispatch_binding_selector = value
129
- elif key == "channel_protocol" and isinstance(value, str):
130
- hot.dispatch_channel_protocol = value
131
- elif key == "channel_selector" and isinstance(value, str):
132
- hot.dispatch_channel_selector = value
133
- elif key == "rpc":
134
- envelope = _coerce_optional_dict(value)
135
- hot.dispatch_rpc_envelope = envelope
136
- if envelope is not None:
137
- hot.dispatch_jsonrpc_request_id = envelope.get("id")
138
- method = envelope.get("method")
139
- hot.dispatch_rpc_method = method if isinstance(method, str) else None
140
- elif key == "rpc_method":
141
- hot.dispatch_rpc_method = value if isinstance(value, str) else None
142
- elif key in {"normalized_input", "parsed_payload"}:
143
- route_payload = _coerce_optional_dict(value)
144
- if route_payload is not None:
145
- hot.route_payload = route_payload
146
- elif key == "jsonrpc_request_id":
147
- hot.dispatch_jsonrpc_request_id = value
148
- elif kind == "egress":
149
- if key == "transport_response":
150
- hot.egress_transport_response = _coerce_optional_dict(value)
151
- elif key == "sent":
152
- hot.egress_sent = bool(value)
153
-
154
-
155
- def _clear_hot_namespace_value(kind: str, hot: HotCtx, key: str) -> None:
156
- if kind == "route":
157
- if key == "selector":
158
- hot.route_selector = ""
159
- elif key == "protocol":
160
- hot.route_protocol = ""
161
- elif key == "program_id":
162
- hot.route_program_id = -1
163
- elif key == "opmeta_index":
164
- hot.route_opmeta_index = -1
165
- elif key == "method_not_allowed":
166
- hot.route_method_not_allowed = False
167
- elif key == "short_circuit":
168
- hot.route_short_circuit = False
169
- elif key == "payload":
170
- hot.route_payload = None
171
- elif key == "path_params":
172
- hot.route_path_params = None
173
- hot.path_params = None
174
- elif key == "rpc_envelope":
175
- hot.route_rpc_envelope = None
176
- hot.dispatch_jsonrpc_request_id = None
177
- hot.dispatch_rpc_method = None
178
- elif kind == "dispatch":
179
- if key == "binding_protocol":
180
- hot.dispatch_binding_protocol = ""
181
- elif key == "binding_selector":
182
- hot.dispatch_binding_selector = ""
183
- elif key == "channel_protocol":
184
- hot.dispatch_channel_protocol = ""
185
- elif key == "channel_selector":
186
- hot.dispatch_channel_selector = ""
187
- elif key == "rpc":
188
- hot.dispatch_rpc_envelope = None
189
- hot.dispatch_jsonrpc_request_id = None
190
- hot.dispatch_rpc_method = None
191
- elif key == "rpc_method":
192
- hot.dispatch_rpc_method = None
193
- elif key == "jsonrpc_request_id":
194
- hot.dispatch_jsonrpc_request_id = None
195
- elif kind == "egress":
196
- if key == "transport_response":
197
- hot.egress_transport_response = None
198
- elif key == "sent":
199
- hot.egress_sent = False
13
+ from .hot_namespace_values import (
14
+ _clear_hot_namespace_value,
15
+ _coerce_optional_dict,
16
+ _namespace_lazy_value,
17
+ _sync_hot_namespace_value,
18
+ )
200
19
 
201
20
 
202
21
  class _HotNamespaceDict(dict[str, Any]):
@@ -0,0 +1,4 @@
1
+ from ._shared import _DirectWebSocketUnary
2
+ from .executor import PackedPlanExecutor
3
+
4
+ __all__ = ["PackedPlanExecutor"]
@@ -0,0 +1,169 @@
1
+ from __future__ import annotations
2
+
3
+ import asyncio
4
+ from collections.abc import Mapping
5
+ from dataclasses import dataclass, fields, is_dataclass
6
+ import inspect
7
+ import json
8
+ from importlib import import_module
9
+ from typing import Any, ClassVar
10
+ from operator import attrgetter
11
+ from types import SimpleNamespace
12
+
13
+ from tigrbl_atoms._ctx import _ctx_view
14
+ from tigrbl_core.config.constants import __JSONRPC_DEFAULT_ENDPOINT_MAPPINGS__
15
+ from tigrbl_atoms.types import build_error_ctx, error_phase_for, select_error_edge
16
+ from tigrbl_atoms.atoms.wire.validate_in import _coerce_if_needed
17
+ from tigrbl_atoms.atoms.transport.websocket_unary import (
18
+ DirectWebSocketUnary as _DirectWebSocketUnary,
19
+ )
20
+ from tigrbl_atoms.packed_inputs import (
21
+ DECODER_BOOL as _DECODER_BOOL,
22
+ DECODER_DATE as _DECODER_DATE,
23
+ DECODER_DATETIME as _DECODER_DATETIME,
24
+ DECODER_DECIMAL as _DECODER_DECIMAL,
25
+ DECODER_FLOAT as _DECODER_FLOAT,
26
+ DECODER_INT as _DECODER_INT,
27
+ DECODER_NONE as _DECODER_NONE,
28
+ DECODER_STR as _DECODER_STR,
29
+ DECODER_TIME as _DECODER_TIME,
30
+ DECODER_UUID as _DECODER_UUID,
31
+ DECODE_STRATEGY_BODY_ONLY_MAPPING as _DECODE_STRATEGY_BODY_ONLY_MAPPING,
32
+ DECODE_STRATEGY_BODY_ONLY_SINGLE_FIELD as _DECODE_STRATEGY_BODY_ONLY_SINGLE_FIELD,
33
+ DECODE_STRATEGY_GENERIC_HASHED as _DECODE_STRATEGY_GENERIC_HASHED,
34
+ PARAM_SOURCE_BODY as _PARAM_SOURCE_BODY,
35
+ PARAM_SOURCE_HEADER as _PARAM_SOURCE_HEADER,
36
+ PARAM_SOURCE_PATH as _PARAM_SOURCE_PATH,
37
+ PARAM_SOURCE_QUERY as _PARAM_SOURCE_QUERY,
38
+ QUERY_VALUE_HAS_PERCENT as _QUERY_VALUE_HAS_PERCENT,
39
+ QUERY_VALUE_HAS_PLUS as _QUERY_VALUE_HAS_PLUS,
40
+ body_hash_items as _atom_body_hash_items,
41
+ coerce_header_pairs as _atom_coerce_header_pairs,
42
+ compiled_lookup_name as _atom_compiled_lookup_name,
43
+ content_type_from_raw_headers as _atom_content_type_from_raw_headers,
44
+ decode_query_span_value as _atom_decode_query_span_value,
45
+ decode_scalar as _atom_decode_scalar,
46
+ ensure_body_bytes as _atom_ensure_body_bytes,
47
+ header_hash_pairs as _atom_header_hash_pairs,
48
+ lookup_hashed_mapping as _atom_lookup_hashed_mapping,
49
+ lookup_hashed_pairs as _atom_lookup_hashed_pairs,
50
+ lookup_query_value as _atom_lookup_query_value,
51
+ parse_query_spans as _atom_parse_query_spans,
52
+ path_hash_items as _atom_path_hash_items,
53
+ publish_compiled_slots as _atom_publish_compiled_slots,
54
+ )
55
+ from tigrbl_kernel.models import (
56
+ KernelPlan,
57
+ OpKey,
58
+ PackedHotSection,
59
+ PackedHotSectionDirectory,
60
+ PackedKernel,
61
+ )
62
+ from tigrbl_kernel.packed_access import (
63
+ DIRECT_INVOKE_RUN as _DIRECT_INVOKE_RUN,
64
+ DIRECT_INVOKE_RUN_WITH_DEP as _DIRECT_INVOKE_RUN_WITH_DEP,
65
+ DIRECT_INVOKE_RUN_WITH_NONE as _DIRECT_INVOKE_RUN_WITH_NONE,
66
+ DIRECT_INVOKE_STEP as _DIRECT_INVOKE_STEP,
67
+ HOT_RUNNER_COMPILED_PARAM as _HOT_RUNNER_COMPILED_PARAM,
68
+ HOT_RUNNER_GENERIC as _HOT_RUNNER_GENERIC,
69
+ HOT_RUNNER_LINEAR_DIRECT as _HOT_RUNNER_LINEAR_DIRECT,
70
+ HOT_RUNNER_WS_UNARY_TEXT as _HOT_RUNNER_WS_UNARY_TEXT,
71
+ HTTP_METHOD_ID_BY_NAME as _HTTP_METHOD_ID_BY_NAME,
72
+ TRANSPORT_KIND_CHANNEL as _TRANSPORT_KIND_CHANNEL,
73
+ TRANSPORT_KIND_GENERIC as _TRANSPORT_KIND_GENERIC,
74
+ TRANSPORT_KIND_JSONRPC as _TRANSPORT_KIND_JSONRPC,
75
+ TRANSPORT_KIND_REST as _TRANSPORT_KIND_REST,
76
+ hot_array as _kernel_hot_array,
77
+ hot_block_sections as _kernel_hot_block_sections,
78
+ hot_block_view as _kernel_hot_block_view,
79
+ hot_count as _kernel_hot_count,
80
+ hot_int_at as _kernel_hot_int_at,
81
+ hot_section as _kernel_hot_section,
82
+ http_method_id as _kernel_http_method_id,
83
+ resolve_program_hot_runner_id as _kernel_resolve_program_hot_runner_id,
84
+ stable_name_hash64 as _kernel_stable_name_hash64,
85
+ )
86
+ from tigrbl_kernel.packed_selectors import (
87
+ normalize_jsonrpc_mount_path as _kernel_normalize_jsonrpc_mount_path,
88
+ resolve_hot_exact_jsonrpc_routes as _kernel_resolve_hot_exact_jsonrpc_routes,
89
+ resolve_hot_exact_route_slices as _kernel_resolve_hot_exact_route_slices,
90
+ resolve_hot_exact_route_verify as _kernel_resolve_hot_exact_route_verify,
91
+ resolve_hot_exact_websocket_routes as _kernel_resolve_hot_exact_websocket_routes,
92
+ resolve_program_id_from_exact_route as _kernel_resolve_program_id_from_exact_route,
93
+ resolve_program_id_from_exact_websocket as _kernel_resolve_program_id_from_exact_websocket,
94
+ )
95
+ from tigrbl_typing.status.exceptions import HTTPException
96
+ from tigrbl_typing.phases import canonicalize_phase_input as normalize_phase
97
+ from tigrbl_typing.status.mappings import status as _status
98
+ from tigrbl_atoms._request import Request
99
+
100
+ from ..base import ExecutorBase
101
+ from ..types import HotCtx, _Ctx
102
+
103
+ _WRAPPER_KEYS = frozenset({"data", "payload", "body", "item"})
104
+ _COMPAT_CONSTANTS = (
105
+ _DECODER_BOOL,
106
+ _DECODER_DATE,
107
+ _DECODER_DATETIME,
108
+ _DECODER_DECIMAL,
109
+ _DECODER_FLOAT,
110
+ _DECODER_INT,
111
+ _DECODER_NONE,
112
+ _DECODER_STR,
113
+ _DECODER_TIME,
114
+ _DECODER_UUID,
115
+ _QUERY_VALUE_HAS_PERCENT,
116
+ _QUERY_VALUE_HAS_PLUS,
117
+ _HTTP_METHOD_ID_BY_NAME,
118
+ )
119
+
120
+
121
+ @dataclass(frozen=True, slots=True)
122
+ class _CompiledInputDescriptor:
123
+ slot_id: int
124
+ lookup_name: str
125
+ source_mask: int
126
+ decoder_id: int
127
+ max_length: int
128
+ lookup_hash: int
129
+ header_hash: int
130
+
131
+
132
+ @dataclass(frozen=True, slots=True)
133
+ class _CompiledFieldPlan:
134
+ slot_id: int
135
+ field_name: str
136
+ required: bool
137
+ nullable: bool | None
138
+ py_type: Any
139
+ coerce: bool
140
+ max_length: int
141
+ validator: Any
142
+ in_enabled: bool
143
+ is_virtual: bool
144
+ default_factory: Any
145
+
146
+
147
+ @dataclass(frozen=True, slots=True)
148
+ class _CompiledParamPlan:
149
+ field_names: tuple[str, ...]
150
+ field_index: Mapping[str, int]
151
+ field_plans: tuple[_CompiledFieldPlan, ...]
152
+ descriptor_plans: tuple[_CompiledInputDescriptor, ...]
153
+ strategy_kind: int
154
+ strategy_rows: tuple[tuple[int, str, int, int], ...]
155
+ assemble_order: tuple[int, ...]
156
+ body_lookup_names: frozenset[str]
157
+ reserved_input_keys: frozenset[str]
158
+ needs_query: bool
159
+ needs_header: bool
160
+ needs_path: bool
161
+
162
+
163
+ __all__ = [
164
+ name
165
+ for name in globals()
166
+ if not name.startswith("__") or name == "__JSONRPC_DEFAULT_ENDPOINT_MAPPINGS__"
167
+ ]
168
+
169
+