export function combineSubscriptions(...teardowns) {
    return () => {
        for (const teardown of teardowns) {
            teardown();
        }
    };
}
export function createStoreBackedReadModel(runtimeServices, getSnapshot) {
    return {
        getSnapshot,
        subscribe(listener) {
            return runtimeServices.runtimeStore.subscribe(listener);
        },
    };
}
export function listProviderIds(runtimeServices) {
    const providerIds = new Set(runtimeServices.providerRegistry.listProviders().map((provider) => provider.name));
    for (const model of runtimeServices.providerRegistry.listModels()) {
        providerIds.add(model.provider);
    }
    return [...providerIds].sort();
}
