fluxloop-cli 0.2.8__py3-none-any.whl → 0.2.10__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.

Potentially problematic release.


This version of fluxloop-cli might be problematic. Click here for more details.

fluxloop_cli/__init__.py CHANGED
@@ -2,7 +2,7 @@
2
2
  FluxLoop CLI - Command-line interface for running agent simulations.
3
3
  """
4
4
 
5
- __version__ = "0.2.8"
5
+ __version__ = "0.2.10"
6
6
 
7
7
  from .main import app
8
8
 
@@ -7,6 +7,25 @@ import json
7
7
  from pathlib import Path
8
8
  from typing import Any, Callable, Dict, Optional
9
9
 
10
+
11
+ class _AttrDict(dict):
12
+ """Dictionary that also supports attribute access for keys."""
13
+
14
+ def __getattr__(self, item: str) -> Any: # type: ignore[override]
15
+ try:
16
+ return self[item]
17
+ except KeyError as exc: # pragma: no cover
18
+ raise AttributeError(item) from exc
19
+
20
+ def __setattr__(self, key: str, value: Any) -> None: # type: ignore[override]
21
+ self[key] = value
22
+
23
+ def __delattr__(self, item: str) -> None: # type: ignore[override]
24
+ try:
25
+ del self[item]
26
+ except KeyError as exc: # pragma: no cover
27
+ raise AttributeError(item) from exc
28
+
10
29
  from fluxloop.schemas import ExperimentConfig, ReplayArgsConfig
11
30
 
12
31
 
@@ -97,7 +116,7 @@ class ArgBinder:
97
116
 
98
117
  self._restore_callables(kwargs, replay)
99
118
  self._ensure_no_unmapped_callables(kwargs, replay)
100
- return kwargs
119
+ return self._hydrate_structures(kwargs)
101
120
 
102
121
  return self._bind_by_signature(func, runtime_input)
103
122
 
@@ -141,7 +160,9 @@ class ArgBinder:
141
160
  callable_markers = {
142
161
  key: value
143
162
  for key, value in kwargs.items()
144
- if isinstance(value, str) and value.startswith("<")
163
+ if isinstance(value, str)
164
+ and value.startswith("<")
165
+ and not value.startswith("<repr:")
145
166
  }
146
167
 
147
168
  if not callable_markers:
@@ -155,6 +176,20 @@ class ArgBinder:
155
176
  f"{', '.join(missing)}. Configure them under replay_args.callable_providers."
156
177
  )
157
178
 
179
+ def _hydrate_structures(self, payload: Dict[str, Any]) -> Dict[str, Any]:
180
+ return {key: self._hydrate_value(value) for key, value in payload.items()}
181
+
182
+ def _hydrate_value(self, value: Any) -> Any:
183
+ if callable(value):
184
+ return value
185
+ if isinstance(value, _AttrDict):
186
+ return value
187
+ if isinstance(value, dict):
188
+ return _AttrDict({k: self._hydrate_value(v) for k, v in value.items()})
189
+ if isinstance(value, list):
190
+ return [self._hydrate_value(item) for item in value]
191
+ return value
192
+
158
193
  def _resolve_builtin_callable(self, provider: str, marker: str) -> Callable:
159
194
  is_async = marker.endswith(":async>")
160
195
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fluxloop-cli
3
- Version: 0.2.8
3
+ Version: 0.2.10
4
4
  Summary: FluxLoop CLI for running agent simulations
5
5
  Author-email: FluxLoop Team <team@fluxloop.dev>
6
6
  License: Apache-2.0
@@ -1,5 +1,5 @@
1
- fluxloop_cli/__init__.py,sha256=cQ5jftUmZZBndl3qNpiGNyEQMmWGM_uxoRRiWjaQq0o,142
2
- fluxloop_cli/arg_binder.py,sha256=ogb7FPdnDK1VYYIUbBWAH-AgsV5xY6yLMhiI352dRjI,8437
1
+ fluxloop_cli/__init__.py,sha256=8aHKnuCYiKZ2JYjaQTCSmi-M_GUENpy7VUSqG399-9I,143
2
+ fluxloop_cli/arg_binder.py,sha256=yaK79zRNBEyTO1CB76WLLKQwYBW404HEKeDC2Y1QlLk,9725
3
3
  fluxloop_cli/config_loader.py,sha256=PYy0CfGVbU8jpPbx4sJzOu7i3BbrkQMNaRiSOp_uX9g,10307
4
4
  fluxloop_cli/config_schema.py,sha256=JZJRcMFun5hp3vKLAyek7W3NvISyzRzZt0BZAeSU38I,2415
5
5
  fluxloop_cli/constants.py,sha256=oMYCkUUqy2LORNY99gDRCOkgLOPrT1FY_Vrylo-QSSw,719
@@ -19,8 +19,8 @@ fluxloop_cli/commands/parse.py,sha256=AVPYi59ejFWx4TYyM7JuI69koxDVkIBxy4LBRDMMbF
19
19
  fluxloop_cli/commands/record.py,sha256=56ASu3Np6TX8_F8caMBJArv10ag5M96kJ-sII8df-5Q,4803
20
20
  fluxloop_cli/commands/run.py,sha256=NLkBN2puqDLdHhKhilLriXsZnm7pMDMcoWeBSEXPM-o,9660
21
21
  fluxloop_cli/commands/status.py,sha256=ERZrWoSP3V7dz5A_TEE5b8E0nGwsPggP4nXw4tLOzxE,7841
22
- fluxloop_cli-0.2.8.dist-info/METADATA,sha256=aNfj7fU6xRDeEShjycEaTXIzFWo1DakGldEIeuFnyas,3664
23
- fluxloop_cli-0.2.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
24
- fluxloop_cli-0.2.8.dist-info/entry_points.txt,sha256=NxOEMku4yLMY5kp_Qcd3JcevfXP6A98FsSf9xHcwkyE,51
25
- fluxloop_cli-0.2.8.dist-info/top_level.txt,sha256=ahLkaxzwhmVU4z-YhkmQVzAbW3-wez9cKnwPiDK7uKM,13
26
- fluxloop_cli-0.2.8.dist-info/RECORD,,
22
+ fluxloop_cli-0.2.10.dist-info/METADATA,sha256=7RmpBYanuT8ROZBYNCaWdrEdXH9lQ5UE85HJoa8beGo,3665
23
+ fluxloop_cli-0.2.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
24
+ fluxloop_cli-0.2.10.dist-info/entry_points.txt,sha256=NxOEMku4yLMY5kp_Qcd3JcevfXP6A98FsSf9xHcwkyE,51
25
+ fluxloop_cli-0.2.10.dist-info/top_level.txt,sha256=ahLkaxzwhmVU4z-YhkmQVzAbW3-wez9cKnwPiDK7uKM,13
26
+ fluxloop_cli-0.2.10.dist-info/RECORD,,