export function resolveThreadSelectionDefaults(options) {
    const userId = options.userId?.trim();
    const providerId = userId && options.userService
        ? options.userService.getSettings(userId).chatProvider
        : undefined;
    const sessionId = options.sessionId?.trim();
    if (!sessionId || !options.sessionState) {
        return { providerId };
    }
    const state = options.sessionState.get(sessionId, ["chat.providerRuntimeMode", "chat.cliModels"]);
    const runtimeMode = state["chat.providerRuntimeMode"] === "full-access" || state["chat.providerRuntimeMode"] === "supervised"
        ? state["chat.providerRuntimeMode"]
        : undefined;
    let model;
    const cliModels = state["chat.cliModels"];
    if (providerId && cliModels && typeof cliModels === "object" && !Array.isArray(cliModels)) {
        const candidate = cliModels[providerId];
        if (typeof candidate === "string" && candidate.trim()) {
            model = candidate.trim();
        }
    }
    return {
        providerId,
        model,
        runtimeMode,
    };
}
//# sourceMappingURL=thread-defaults.js.map