- add startup ProviderHealth service/layer to probe Codex install and auth state - extend server contracts and WS payloads to include provider statuses - show non-ready provider warnings in ChatView and cover with server/web tests
23 lines
698 B
TypeScript
23 lines
698 B
TypeScript
/**
|
|
* ProviderHealth - Provider readiness snapshot service.
|
|
*
|
|
* Owns startup-time provider health checks (install/auth reachability) and
|
|
* exposes the cached results to transport layers.
|
|
*
|
|
* @module ProviderHealth
|
|
*/
|
|
import type { ServerProviderStatus } from "@t3tools/contracts";
|
|
import { ServiceMap } from "effect";
|
|
import type { Effect } from "effect";
|
|
|
|
export interface ProviderHealthShape {
|
|
/**
|
|
* Read provider health statuses computed at server startup.
|
|
*/
|
|
readonly getStatuses: Effect.Effect<ReadonlyArray<ServerProviderStatus>>;
|
|
}
|
|
|
|
export class ProviderHealth extends ServiceMap.Service<ProviderHealth, ProviderHealthShape>()(
|
|
"t3/provider/Services/ProviderHealth",
|
|
) {}
|