# SPDX-License-Identifier: AGPL-3.0-only
# Copyright (c) 2026 sol pbc

"""Locked copy for convey onboarding, settings, and pairing surfaces."""

from __future__ import annotations

CONVEY_RELOAD_HINT = "reload to try again."
CONVEY_UNKNOWN_ERROR = (
    "something went wrong and i don't have a reason for it. reload to try again."
)
CONVEY_LOG_READ_FAILED = "i couldn't read that log. reload to try again."
CONVEY_ACTION_TRY_AGAIN = "Try again"  # generic load-failure retry button
CONVEY_ACTION_RELOAD = "Reload"  # full-surface reload affordance
CONVEY_ACTION_RECONNECT = "reconnect"  # transport/socket reconnection affordance
CONVEY_ACTION_RESTART = "restart"  # service/observer restart affordance
CONVEY_CONSOLE_HEADING = "system messages"
CONVEY_CONSOLE_EMPTY = "I haven't seen any system messages this session."
CONVEY_CONSOLE_TAB_ALL = "all"
CONVEY_CONSOLE_TAB_ERRORS = "errors"
CONVEY_CONSOLE_TAB_WARNINGS = "warnings"
CONVEY_CONSOLE_TAB_INFO = "info"
CONVEY_CONSOLE_LINK_LABEL = "system messages"
CONVEY_CONSOLE_ACTION_SEND = "send"
CONVEY_CONSOLE_ACTION_SEND_ALL = "send all"
CONVEY_CONSOLE_ACTION_CLEAR = "clear"
CONVEY_CONSOLE_ACTION_SHOW_DETAILS = "show details"
CONVEY_CONSOLE_ACTION_CLOSE = "close"
CONVEY_CONSOLE_REPORTING_OFF = "I can show these messages, but sending reports is off."
CONVEY_CONSOLE_SNAPSHOT_HEADING = "snapshot of {count} system messages"
CONVEY_CONSOLE_REPORT_HEADING = "Last {count} console entries:"
CONVEY_CONSOLE_TRUNCATED = "[older entries truncated]"
CONVEY_CONSOLE_DETAIL_MESSAGE_LABEL = "message"
CONVEY_CONSOLE_DETAIL_STACK_LABEL = "stack"
CONVEY_CONSOLE_DETAIL_LOCATION_LABEL = "location"
CONVEY_REPORT_TITLE = "I can send this report to sol pbc"
CONVEY_REPORT_DEFAULT_SUBJECT = "convey error"
CONVEY_REPORT_SUBJECT_LABEL = "subject"
CONVEY_REPORT_DETAIL_LABEL = "what happened"
CONVEY_REPORT_DETAIL_PLACEHOLDER = "anything else worth knowing? (optional)"
CONVEY_REPORT_SEVERITY_LABEL = "severity"
CONVEY_REPORT_SEVERITY_LOW = "low"
CONVEY_REPORT_SEVERITY_MEDIUM = "medium"
CONVEY_REPORT_SEVERITY_HIGH = "high"
CONVEY_REPORT_ANONYMOUS_LABEL = "submit anonymously"
CONVEY_REPORT_DIAGNOSTIC_SUMMARY = "diagnostic context"
CONVEY_REPORT_DIAGNOSTIC_FOOTER = (
    "(System snapshot bundled server-side via support_create's auto_context=true path.)"
)
CONVEY_REPORT_DIAGNOSTIC_HTTP_STATUS_LABEL = "HTTP status"
CONVEY_REPORT_DIAGNOSTIC_STATUS_TEXT_LABEL = "Status text"
CONVEY_REPORT_DIAGNOSTIC_REQUEST_URL_LABEL = "Request URL"
CONVEY_REPORT_DIAGNOSTIC_SERVER_REASON_LABEL = "Server reason"
CONVEY_REPORT_DIAGNOSTIC_CORRELATION_ID_LABEL = "Correlation ID"
CONVEY_REPORT_DIAGNOSTIC_REASON_CODE_LABEL = "reason code"
CONVEY_REPORT_DIAGNOSTIC_TIME_LABEL = "time"
CONVEY_REPORT_DIAGNOSTIC_RAW_DETAIL_LABEL = "Raw detail"
CONVEY_REPORT_DIAGNOSTIC_CONSOLE_HEADING = "Last 5 console entries:"
CONVEY_REPORT_NO_CONSOLE = "(no console entries captured yet)"
CONVEY_REPORT_ACTION_SEND = "send report"
CONVEY_REPORT_ACTION_SENDING = "sending…"
CONVEY_REPORT_ACTION_CANCEL = "cancel"
CONVEY_REPORT_ACTION_CLOSE = "close"
CONVEY_REPORT_ACTION_OPEN_EMAIL = "open email draft"
CONVEY_REPORT_ACTION_VIEW_TICKET = "view ticket"
CONVEY_REPORT_SUCCESS_BODY = "i sent your report. reference #{ticket_id}."
CONVEY_REPORT_SUCCESS_BODY_NO_ID = "I sent your report."
CONVEY_REPORT_FALLBACK_HEADLINE = "I couldn't reach support"
CONVEY_REPORT_FALLBACK_BODY = "here's your report. paste it in an email."
CONVEY_REPORT_FAILURE_HTTP_PREFIX = "HTTP"
CONVEY_REPORT_FAILURE_REFERENCE_PREFIX = "reference"
CONVEY_REPORT_MAILTO_BODY_PREFIX = (
    "I couldn't send this through convey, so here's the report.\n\n"
)
CONVEY_REPORT_MAILTO_TRUNCATION_SUFFIX = "\n\n[full report is in your clipboard]\n"
CONVEY_REPORT_BUTTON_LABEL = "report this"
OBSERVER_CALLOSUM_LIVE_LABEL = "live"


def format_convey_status(
    *,
    bind: str,
    dashboard_url: str,
) -> str:
    """Return the locked convey status block."""

    return f"convey\n  bind:              {bind}\n  dashboard url:     {dashboard_url}"


__all__ = [
    "CONVEY_ACTION_TRY_AGAIN",
    "CONVEY_ACTION_RELOAD",
    "CONVEY_ACTION_RECONNECT",
    "CONVEY_ACTION_RESTART",
    "CONVEY_CONSOLE_ACTION_CLEAR",
    "CONVEY_CONSOLE_ACTION_CLOSE",
    "CONVEY_CONSOLE_ACTION_SEND",
    "CONVEY_CONSOLE_ACTION_SEND_ALL",
    "CONVEY_CONSOLE_ACTION_SHOW_DETAILS",
    "CONVEY_CONSOLE_DETAIL_LOCATION_LABEL",
    "CONVEY_CONSOLE_DETAIL_MESSAGE_LABEL",
    "CONVEY_CONSOLE_DETAIL_STACK_LABEL",
    "CONVEY_CONSOLE_EMPTY",
    "CONVEY_CONSOLE_HEADING",
    "CONVEY_CONSOLE_LINK_LABEL",
    "CONVEY_CONSOLE_REPORTING_OFF",
    "CONVEY_CONSOLE_REPORT_HEADING",
    "CONVEY_CONSOLE_SNAPSHOT_HEADING",
    "CONVEY_CONSOLE_TAB_ALL",
    "CONVEY_CONSOLE_TAB_ERRORS",
    "CONVEY_CONSOLE_TAB_INFO",
    "CONVEY_CONSOLE_TAB_WARNINGS",
    "CONVEY_CONSOLE_TRUNCATED",
    "CONVEY_LOG_READ_FAILED",
    "CONVEY_RELOAD_HINT",
    "CONVEY_REPORT_ACTION_CANCEL",
    "CONVEY_REPORT_ACTION_CLOSE",
    "CONVEY_REPORT_ACTION_OPEN_EMAIL",
    "CONVEY_REPORT_ACTION_SEND",
    "CONVEY_REPORT_ACTION_SENDING",
    "CONVEY_REPORT_ACTION_VIEW_TICKET",
    "CONVEY_REPORT_ANONYMOUS_LABEL",
    "CONVEY_REPORT_BUTTON_LABEL",
    "CONVEY_REPORT_DEFAULT_SUBJECT",
    "CONVEY_REPORT_DETAIL_LABEL",
    "CONVEY_REPORT_DETAIL_PLACEHOLDER",
    "CONVEY_REPORT_DIAGNOSTIC_CONSOLE_HEADING",
    "CONVEY_REPORT_DIAGNOSTIC_CORRELATION_ID_LABEL",
    "CONVEY_REPORT_DIAGNOSTIC_FOOTER",
    "CONVEY_REPORT_DIAGNOSTIC_HTTP_STATUS_LABEL",
    "CONVEY_REPORT_DIAGNOSTIC_RAW_DETAIL_LABEL",
    "CONVEY_REPORT_DIAGNOSTIC_REASON_CODE_LABEL",
    "CONVEY_REPORT_DIAGNOSTIC_REQUEST_URL_LABEL",
    "CONVEY_REPORT_DIAGNOSTIC_SERVER_REASON_LABEL",
    "CONVEY_REPORT_DIAGNOSTIC_STATUS_TEXT_LABEL",
    "CONVEY_REPORT_DIAGNOSTIC_SUMMARY",
    "CONVEY_REPORT_DIAGNOSTIC_TIME_LABEL",
    "CONVEY_REPORT_FALLBACK_BODY",
    "CONVEY_REPORT_FALLBACK_HEADLINE",
    "CONVEY_REPORT_FAILURE_HTTP_PREFIX",
    "CONVEY_REPORT_FAILURE_REFERENCE_PREFIX",
    "CONVEY_REPORT_MAILTO_BODY_PREFIX",
    "CONVEY_REPORT_MAILTO_TRUNCATION_SUFFIX",
    "CONVEY_REPORT_NO_CONSOLE",
    "CONVEY_REPORT_SEVERITY_HIGH",
    "CONVEY_REPORT_SEVERITY_LABEL",
    "CONVEY_REPORT_SEVERITY_LOW",
    "CONVEY_REPORT_SEVERITY_MEDIUM",
    "CONVEY_REPORT_SUBJECT_LABEL",
    "CONVEY_REPORT_SUCCESS_BODY",
    "CONVEY_REPORT_SUCCESS_BODY_NO_ID",
    "CONVEY_REPORT_TITLE",
    "CONVEY_UNKNOWN_ERROR",
    "OBSERVER_CALLOSUM_LIVE_LABEL",
    "format_convey_status",
]
