import { nowIso } from '../fsx.js';
export const APPSHOTS_OPERATOR_POLICY_SCHEMA = 'sks.appshots-operator-policy.v1';
export function buildAppshotsOperatorPolicy(capability, input = {}) {
    const operatorActionRecorded = input.operatorActionRecorded === true;
    const operatorRequired = capability.operator_action_required;
    const missingOperatorAction = operatorRequired && !operatorActionRecorded;
    return {
        schema: APPSHOTS_OPERATOR_POLICY_SCHEMA,
        generated_at: nowIso(),
        ok: !missingOperatorAction,
        mode: capability.status === 'available' ? 'tool_available' : capability.visual_required ? 'operator_assisted' : 'not_required',
        operator_action_required: operatorRequired,
        privacy_safety: {
            redact_sensitive_text: true,
            avoid_secrets_and_credentials: true,
            require_user_visible_app_state_only: true,
            no_background_screen_capture: true
        },
        accepted_sources: input.sourcePaths?.map(String) || [],
        blockers: missingOperatorAction ? ['appshots_operator_action_missing'] : [],
        warnings: capability.visual_required && !operatorRequired ? [] : operatorRequired ? ['operator_must_explicitly_attach_or_confirm_appshot'] : []
    };
}
//# sourceMappingURL=appshots-operator-policy.js.map