MCPcopy
hub / github.com/openai/plugins / inventory_resources

Function inventory_resources

plugins/ngs-analysis/scripts/ngs_reference_manager.py:844–916  ·  view source on GitHub ↗
(
    *,
    kind: str = "all",
    bundle_roots: dict[str, Path] | None = None,
    include_checksums: bool = False,
    registries: dict[str, Any] | None = None,
)

Source from the content-addressed store, hash-verified

842
843
844def inventory_resources(
845 *,
846 kind: str = "all",
847 bundle_roots: dict[str, Path] | None = None,
848 include_checksums: bool = False,
849 registries: dict[str, Any] | None = None,
850) -> dict[str, Any]:
851 registries = registries or load_registries()
852 bundle_roots = bundle_roots or {}
853 usage = pipeline_usage_by_bundle(registries)
854 bundles: list[dict[str, Any]] = []
855 rows: list[dict[str, Any]] = []
856 for item_kind, name, payload in iter_bundle_payloads(registries, kind=kind):
857 check = check_named_bundle(
858 name,
859 kind=item_kind,
860 root=bundle_roots.get(name),
861 include_checksums=include_checksums,
862 registries=registries,
863 )
864 bundle_usage = usage.get(name, {"required": [], "optional": []})
865 missing = check.get("missing", [])
866 env = env_assignment(payload, check.get("root"))
867 configured_root = str(bundle_roots[name]) if name in bundle_roots else check.get("root")
868 record = {
869 "kind": item_kind,
870 "bundle": name,
871 "display_name": payload.get("display_name", name),
872 "ok": bool(check.get("ok")),
873 "root": configured_root,
874 "root_env": payload.get("root_env"),
875 "env": env,
876 "required_file_count": len(payload.get("required_files", [])),
877 "missing_count": len(missing),
878 "missing": missing,
879 "estimated_size": payload.get("estimated_size"),
880 "source": payload.get("source"),
881 "license_note": payload.get("license_note"),
882 "suggested_setup": payload.get("suggested_setup", []),
883 "pipelines_required": bundle_usage.get("required", []),
884 "pipelines_optional": bundle_usage.get("optional", []),
885 "check": check,
886 }
887 bundles.append(record)
888 rows.append(
889 {
890 "kind": item_kind,
891 "bundle": name,
892 "display_name": record["display_name"],
893 "ok": str(record["ok"]).lower(),
894 "root": record["root"] or "",
895 "root_env": record["root_env"] or "",
896 "required_file_count": record["required_file_count"],
897 "missing_count": record["missing_count"],
898 "missing_files": ";".join(missing),
899 "pipelines_required": ";".join(record["pipelines_required"]),
900 "pipelines_optional": ";".join(record["pipelines_optional"]),
901 "estimated_size": record["estimated_size"] or "",

Callers 1

mainFunction · 0.85

Calls 7

now_isoFunction · 0.90
load_registriesFunction · 0.85
pipeline_usage_by_bundleFunction · 0.85
iter_bundle_payloadsFunction · 0.85
check_named_bundleFunction · 0.85
env_assignmentFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected