MCPcopy Create free account
hub / github.com/caverav/flutterdec / _bootflow_candidates_from_name

Function _bootflow_candidates_from_name

adapters/python/adapter_template.py:171–255  ·  view source on GitHub ↗
(
    name: str, owner_class: str, library_uri: str
)

Source from the content-addressed store, hash-verified

169 "executable": h["executable"],
170 }
171 for h in request["inputs"]
172 ]
173
174
175def _region_va(request: dict, region: str) -> int:
176 return int(_handle(request, region).get("virtual_address") or 0)
177
178
179def _write_result(
180 path: Path,
181 status: str,
182 model: Optional[str] = None,
183 error: Optional[dict] = None,
184 resolved_backend: Optional[str] = None,
185 fallback_reason: Optional[str] = None,
186 diagnostics: Optional[List[dict]] = None,
187) -> None:
188 payload = {
189 "protocol_major": PROTOCOL_MAJOR,
190 "model_major": MODEL_VERSION,
191 "status": status,
192 "model": model,
193 "error": error,
194 "resolved_backend": resolved_backend,
195 "fallback_reason": fallback_reason,
196 "diagnostics": diagnostics or [],
197 }
198 path.write_text(json.dumps(payload, indent=2), encoding="utf-8")
199
200
201# --------------------------------------------------------------------------
202# model v4 assembly
203# --------------------------------------------------------------------------
204
205
206def _diagnostic(code: str, message: str, subject: Optional[str] = None,
207 severity: str = "warning") -> dict:
208 return {"code": code, "severity": severity, "subject": subject, "message": message}
209
210
211def _name(text: str, provenance: str) -> dict:
212 # `confidence` stays null everywhere in this file. A number here would look
213 # calibrated, and none of these backends has anything to calibrate against.
214 return {"text": text, "provenance": provenance, "confidence": None}
215
216
217def _build_model(
218 request: dict,
219 capabilities: Dict[str, str],
220 libraries: List[dict],
221 classes: List[dict],
222 functions: List[dict],
223 object_pool: dict,
224 diagnostics: List[dict],
225) -> dict:
226 """Assemble a v4 model and add the diagnostic every unavailable domain owes.
227
228 Validation rejects an unavailable domain with nothing said about it, which

Callers 1

_parse_blutter_asmFunction · 0.85

Calls 1

_selector_from_stringFunction · 0.85

Tested by

no test coverage detected