import { hasProjectTrustInputs } from "./core/trust-manager.js";
export function computeStartupInputCaptureEnabled(input) {
    if (input.parsed.resume || input.parsed.session !== undefined)
        return false;
    const hasTrustInputs = hasProjectTrustInputs(input.sessionCwd);
    return input.deprecationWarningCount === 0 && computeDeferExtensions({
        appMode: input.appMode,
        stdinIsTTY: input.stdinIsTTY,
        hasSessionStartEvent: false,
        help: input.parsed.help,
        listModels: input.parsed.listModels,
        shouldResolveProjectTrust: input.parsed.projectTrustOverride === undefined && hasTrustInputs,
        storedProjectTrust: hasTrustInputs ? input.projectTrustStore.get(input.sessionCwd) : null,
        resolvedExtensionPathCount: input.resolvedExtensionPathCount,
        resolvedResourcePathCount: input.resolvedResourcePathCount,
        hasSystemPromptInput: input.parsed.systemPrompt !== undefined || (input.parsed.appendSystemPrompt?.length ?? 0) > 0,
        unknownFlagCount: input.parsed.unknownFlags.size,
        provider: input.parsed.provider,
        model: input.parsed.model,
    });
}
export function computeDeferExtensions(input) {
    return (input.appMode === "interactive" &&
        input.stdinIsTTY &&
        !input.hasSessionStartEvent &&
        !input.help &&
        input.listModels === undefined &&
        (!input.shouldResolveProjectTrust || input.storedProjectTrust !== null) &&
        input.resolvedExtensionPathCount === 0 &&
        input.resolvedResourcePathCount === 0 &&
        !input.hasSystemPromptInput &&
        input.provider === undefined &&
        input.model === undefined &&
        input.unknownFlagCount === 0);
}
export function formatScopedModelList(scopedModels) {
    return scopedModels
        .map((scoped) => {
        const thinkingSuffix = scoped.thinkingLevel ? `:${scoped.thinkingLevel}` : "";
        return `${scoped.model.id}${thinkingSuffix}`;
    })
        .join(", ");
}
//# sourceMappingURL=main-deferred-startup.js.map