Attach a concrete value to a callback dependency to produce a valid callback input. For regular deps, returns ``{id, property, value}``. For ALL/ALLSMALLER: passes through the list of ``{id, property, value}`` dicts. For MATCH: passes through the single ``{id, property, value}`` di
(dep: CallbackDependency, value: Any)
| 363 | |
| 364 | |
| 365 | def _expand_dep(dep: CallbackDependency, value: Any) -> CallbackInputs: |
| 366 | """ |
| 367 | Attach a concrete value to a callback dependency to produce a valid callback input. |
| 368 | |
| 369 | For regular deps, returns ``{id, property, value}``. |
| 370 | For ALL/ALLSMALLER: passes through the list of ``{id, property, value}`` dicts. |
| 371 | For MATCH: passes through the single ``{id, property, value}`` dict. |
| 372 | """ |
| 373 | pattern = parse_wildcard_id(dep.get("id", "")) |
| 374 | if pattern is None: |
| 375 | return CallbackInput(id=dep["id"], property=dep["property"], value=value) |
| 376 | |
| 377 | # LLM provides browser-like format |
| 378 | if isinstance(value, list): |
| 379 | return cast("list[CallbackInput]", value) |
| 380 | if isinstance(value, dict) and "id" in value: |
| 381 | return cast(CallbackInput, value) |
| 382 | return CallbackInput(id=dep["id"], property=dep["property"], value=value) |
| 383 | |
| 384 | |
| 385 | def _expand_output_spec( |
no test coverage detected
searching dependent graphs…