@fayz-ai/plugin-support 0.3.0-canary.20261028142749 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/dist/{HelpdeskConsole-QY534ASZ.js → HelpdeskConsole-EATEBVLN.js} +10 -7
  2. package/dist/HelpdeskConsole-EATEBVLN.js.map +1 -0
  3. package/dist/{LiveChatAgentWatcher-J6PNLYWT.js → LiveChatAgentWatcher-WEUHRRLC.js} +17 -23
  4. package/dist/LiveChatAgentWatcher-WEUHRRLC.js.map +1 -0
  5. package/dist/{OpenTicketFromConversation-KDXK7A6L.js → OpenTicketFromConversation-RC26KHN3.js} +4 -4
  6. package/dist/{OpenTicketFromConversation-KDXK7A6L.js.map → OpenTicketFromConversation-RC26KHN3.js.map} +1 -1
  7. package/dist/{SupportCenter-JBBBJTKU.js → SupportCenter-HGQL4PBX.js} +12 -9
  8. package/dist/SupportCenter-HGQL4PBX.js.map +1 -0
  9. package/dist/{SupportSettingsPage-PB6A3VCI.js → SupportSettingsPage-LIVZY2XQ.js} +3 -3
  10. package/dist/{SupportSettingsPage-PB6A3VCI.js.map → SupportSettingsPage-LIVZY2XQ.js.map} +1 -1
  11. package/dist/chunk-3WPESEK2.js +136 -0
  12. package/dist/chunk-3WPESEK2.js.map +1 -0
  13. package/dist/chunk-5MGCM5C4.js +181 -0
  14. package/dist/chunk-5MGCM5C4.js.map +1 -0
  15. package/dist/{chunk-PIMV3VRT.js → chunk-DTO5R6GN.js} +26 -126
  16. package/dist/chunk-DTO5R6GN.js.map +1 -0
  17. package/dist/chunk-E5242OSS.js +88 -0
  18. package/dist/chunk-E5242OSS.js.map +1 -0
  19. package/dist/{chunk-M4LUNCKI.js → chunk-E5EXC7QW.js} +57 -16
  20. package/dist/chunk-E5EXC7QW.js.map +1 -0
  21. package/dist/chunk-JOS2QQML.js +17 -0
  22. package/dist/chunk-JOS2QQML.js.map +1 -0
  23. package/dist/{chunk-WOZTA5LS.js → chunk-L2HGTGW4.js} +6 -4
  24. package/dist/chunk-L2HGTGW4.js.map +1 -0
  25. package/dist/{chunk-37ZZRVI7.js → chunk-P4VNMWIT.js} +79 -186
  26. package/dist/chunk-P4VNMWIT.js.map +1 -0
  27. package/dist/{chunk-CWCN5PDE.js → chunk-PHIPTZSD.js} +48 -5
  28. package/dist/chunk-PHIPTZSD.js.map +1 -0
  29. package/dist/chunk-QBOQYER7.js +1603 -0
  30. package/dist/chunk-QBOQYER7.js.map +1 -0
  31. package/dist/{chunk-MQXGB4IO.js → chunk-S766CRAY.js} +42 -239
  32. package/dist/chunk-S766CRAY.js.map +1 -0
  33. package/dist/chunk-WHEJ63CM.js +156 -0
  34. package/dist/chunk-WHEJ63CM.js.map +1 -0
  35. package/dist/chunk-Y673XGDK.js +261 -0
  36. package/dist/chunk-Y673XGDK.js.map +1 -0
  37. package/dist/data/api.d.ts +5 -0
  38. package/dist/data/api.d.ts.map +1 -1
  39. package/dist/data/console.d.ts +6 -0
  40. package/dist/data/console.d.ts.map +1 -1
  41. package/dist/data/mock-host.d.ts.map +1 -1
  42. package/dist/data/provider.d.ts +12 -0
  43. package/dist/data/provider.d.ts.map +1 -1
  44. package/dist/host.d.ts +21 -0
  45. package/dist/host.d.ts.map +1 -1
  46. package/dist/host.js +24 -10
  47. package/dist/host.js.map +1 -1
  48. package/dist/in-chat-install-2BTKBF2Z.js +11 -0
  49. package/dist/in-chat-install-2BTKBF2Z.js.map +1 -0
  50. package/dist/index.js +18 -191
  51. package/dist/index.js.map +1 -1
  52. package/dist/lib/imported.d.ts +27 -0
  53. package/dist/lib/imported.d.ts.map +1 -0
  54. package/dist/lib/report-tool.d.ts +54 -9
  55. package/dist/lib/report-tool.d.ts.map +1 -1
  56. package/dist/lib/vocabulary.d.ts.map +1 -1
  57. package/dist/livechat/LiveChatAgentWatcher.d.ts +3 -2
  58. package/dist/livechat/LiveChatAgentWatcher.d.ts.map +1 -1
  59. package/dist/livechat/in-chat-install.d.ts +19 -0
  60. package/dist/livechat/in-chat-install.d.ts.map +1 -0
  61. package/dist/livechat/in-chat-link.d.ts +10 -0
  62. package/dist/livechat/in-chat-link.d.ts.map +1 -0
  63. package/dist/livechat/in-chat-machine.d.ts +99 -0
  64. package/dist/livechat/in-chat-machine.d.ts.map +1 -0
  65. package/dist/livechat/in-chat-request-machine.d.ts +147 -0
  66. package/dist/livechat/in-chat-request-machine.d.ts.map +1 -0
  67. package/dist/livechat/in-chat-request.d.ts +94 -0
  68. package/dist/livechat/in-chat-request.d.ts.map +1 -0
  69. package/dist/livechat/in-chat-widgets.d.ts +39 -0
  70. package/dist/livechat/in-chat-widgets.d.ts.map +1 -0
  71. package/dist/livechat/in-chat.d.ts +119 -0
  72. package/dist/livechat/in-chat.d.ts.map +1 -0
  73. package/dist/livechat/report-intake.d.ts +45 -0
  74. package/dist/livechat/report-intake.d.ts.map +1 -0
  75. package/dist/livechat/screen-capture.d.ts +7 -0
  76. package/dist/livechat/screen-capture.d.ts.map +1 -0
  77. package/dist/migrations/index.d.ts +2 -0
  78. package/dist/migrations/index.d.ts.map +1 -1
  79. package/dist/migrations/main.browser.js +3 -1
  80. package/dist/migrations/main.browser.js.map +1 -1
  81. package/dist/migrations/main.js +1181 -2
  82. package/dist/migrations/main.js.map +1 -1
  83. package/dist/realtime-HQVWBTML.js +3 -0
  84. package/dist/realtime-HQVWBTML.js.map +1 -0
  85. package/dist/screen-capture-FRMTTRUY.js +77 -0
  86. package/dist/screen-capture-FRMTTRUY.js.map +1 -0
  87. package/dist/types.d.ts +5 -1
  88. package/dist/types.d.ts.map +1 -1
  89. package/dist/views/SupportRequestsPanel.d.ts.map +1 -1
  90. package/dist/views/TicketSheet.d.ts +11 -1
  91. package/dist/views/TicketSheet.d.ts.map +1 -1
  92. package/package.json +5 -5
  93. package/dist/HelpdeskConsole-QY534ASZ.js.map +0 -1
  94. package/dist/LiveChatAgentWatcher-J6PNLYWT.js.map +0 -1
  95. package/dist/SupportCenter-JBBBJTKU.js.map +0 -1
  96. package/dist/chunk-37ZZRVI7.js.map +0 -1
  97. package/dist/chunk-CWCN5PDE.js.map +0 -1
  98. package/dist/chunk-JT4ZPWH7.js +0 -61
  99. package/dist/chunk-JT4ZPWH7.js.map +0 -1
  100. package/dist/chunk-M4LUNCKI.js.map +0 -1
  101. package/dist/chunk-MQXGB4IO.js.map +0 -1
  102. package/dist/chunk-PIMV3VRT.js.map +0 -1
  103. package/dist/chunk-STEDUFNR.js +0 -42
  104. package/dist/chunk-STEDUFNR.js.map +0 -1
  105. package/dist/chunk-WOZTA5LS.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/data/provider.ts"],"names":[],"mappings":";;;AAmDO,IAAM,uBAAA,GAA+C;AAAA,EAC1D,YAAA;AAAA,EACA,gBAAA;AAAA,EACA,WAAA;AAAA,EACA,MAAM,aAAA,CAAc,KAAA,EAAO,WAAA,EAAa;AACtC,IAAA,MAAM,GAAA,GAAM,MAAU,aAAA,CAAc,KAAK,CAAA;AAEzC,IAAA,KAAA,MAAW,OAAA,IAAW,WAAA,CAAY,KAAA,CAAM,CAAA,EAAG,CAAC,CAAA,EAAG;AAC7C,MAAA,IAAI;AACF,QAAA,MAAU,gBAAA,CAAiB,GAAA,CAAI,EAAA,EAAI,OAAO,CAAA;AAAA,MAC5C,CAAA,CAAA,MAAQ;AAAA,MAGR;AAAA,IACF;AACA,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AAAA,EACA,UAAA;AAAA,EACA,aAAA;AAAA,EACA,eAAA;AAAA,EACA,qBAAA;AAAA,EACA,aAAA,EAAe,CAAC,GAAA,KAAY,SAAA,CAAU,IAAI,WAAW,CAAA;AAAA,EACrD,gBAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,QAAA,EAAU;AACZ,CAAA;AAEA,IAAI,MAAA,GAAqC,IAAA;AAGlC,SAAS,uBAAuB,QAAA,EAA4C;AACjF,EAAA,MAAA,GAAS,QAAA;AACX;AAEO,SAAS,WAAA,GAAmC;AACjD,EAAA,OAAO,MAAA,IAAU,uBAAA;AACnB;AAGO,SAAS,eAAA,GAA2B;AACzC,EAAA,OAAO,WAAA,GAAc,QAAA,KAAa,KAAA;AACpC","file":"chunk-STEDUFNR.js","sourcesContent":["// The requester's data port. On the platform the screens talk to Supabase\n// directly (PostgREST + RLS + the support RPCs, data/api.ts and livechat/api.ts);\n// a HOST (a legacy product drawing these screens, `@fayz-ai/plugin-support/host`)\n// injects its own provider instead — e.g. the V1, whose browser has no session in\n// this pool, sends every call through its own edge to the bridge.\n//\n// One active provider per page: the screens read `supportData()`; the host entry\n// installs its provider and restores the platform one on dispose.\nimport type {\n SupportRequest, SupportRequestDetail, SupportScope, SupportFilter, SupportAttachment,\n CreateSupportRequestInput, PendingAttachment,\n} from '../types'\nimport type { ChatAvailability, ChatState, OpenChatInput } from '../livechat/api'\nimport * as api from './api'\nimport * as chat from '../livechat/api'\n\n/** One message of the live chat as the customer reads it. */\nexport interface ChatThreadMessage { id: string; mine: boolean; author: string | null; body: string; at: string }\n\nexport interface SupportDataProvider {\n listRequests(scope: SupportScope, filter: SupportFilter): Promise<SupportRequest[]>\n getRequestDetail(id: string): Promise<SupportRequestDetail | null>\n /** The orange \"Esperando você\" counter. */\n unreadCount(): Promise<number>\n /** Opens the request AND sends its attachments; one failed file does not fail the request. */\n createRequest(input: CreateSupportRequestInput, attachments: PendingAttachment[]): Promise<{ id: string; number: number }>\n addMessage(requestId: string, body: string): Promise<void>\n cancelRequest(requestId: string): Promise<void>\n validateRequest(requestId: string, ok: boolean, reason?: string): Promise<void>\n markNotificationsRead(requestId: string): Promise<void>\n /** A link to show/download an attachment; null = none. */\n attachmentUrl(att: SupportAttachment): Promise<string | null>\n\n // ── the live chat (support 020) ──\n /** null = no live chat for this account. `online` set = the provider counts the agents (no Realtime here). */\n chatAvailability(): Promise<ChatAvailability | null>\n openChat(input: OpenChatInput): Promise<{ id: string; number: number; conversationId: string | null; reused: boolean }>\n chatState(requestId: string): Promise<ChatState>\n chatThread(requestId: string): Promise<ChatThreadMessage[]>\n\n /**\n * false = there is no Realtime of this pool in the page (a host): the screens\n * poll instead of listening to the conversation bell and the agents' presence,\n * and \"digitando…\" is not offered. Default true.\n */\n realtime?: boolean\n /** How often an open request / chat is re-read when there is no bell (ms). Default 15000 / 20000. */\n pollMs?: { detail?: number; chat?: number; door?: number }\n}\n\n/** The platform's own provider: the functions the screens always used. */\nexport const platformSupportProvider: SupportDataProvider = {\n listRequests: api.listRequests,\n getRequestDetail: api.getRequestDetail,\n unreadCount: api.unreadCount,\n async createRequest(input, attachments) {\n const res = await api.createRequest(input)\n // Attachments are a second step: the file can only land once the request exists.\n for (const pending of attachments.slice(0, 8)) {\n try {\n await api.uploadAttachment(res.id, pending)\n } catch {\n // One failed upload does not fail the request — V1 opens it anyway and\n // lets the file be re-sent inside the request.\n }\n }\n return res\n },\n addMessage: api.addMessage,\n cancelRequest: api.cancelRequest,\n validateRequest: api.validateRequest,\n markNotificationsRead: api.markNotificationsRead,\n attachmentUrl: (att) => api.signedUrl(att.storagePath),\n chatAvailability: chat.chatAvailability,\n openChat: chat.openChat,\n chatState: chat.chatState,\n chatThread: chat.chatThread,\n realtime: true,\n}\n\nlet active: SupportDataProvider | null = null\n\n/** Installs a host's provider (null restores the platform's). */\nexport function setSupportDataProvider(provider: SupportDataProvider | null): void {\n active = provider\n}\n\nexport function supportData(): SupportDataProvider {\n return active ?? platformSupportProvider\n}\n\n/** true when the page has this pool's Realtime (the platform); false in a host. */\nexport function supportRealtime(): boolean {\n return supportData().realtime !== false\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/lib/vocabulary.ts"],"names":[],"mappings":";AAKO,IAAM,UAAA,GAA0C;AAAA,EACrD,QAAA,EAAU,WAAA;AAAA,EACV,OAAA,EAAS,UAAA;AAAA,EACT,WAAA,EAAa,yBAAA;AAAA,EACb,KAAA,EAAO,yBAAA;AAAA,EAC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AA,IAAK,IAAA;AACrD,IAAA,OAAO,cAAc,KAAK,CAAA,CAAA;AAAA,EAC5B;AACA,EAAA,IAAI,IAAA,KAAS,UAAA,IAAc,IAAA,EAAM,OAAO,aAAa,IAAI,CAAA,CAAA;AACzD,EAAA,OAAO,WAAA,CAAY,IAAI,CAAA,IAAK,IAAA;AAC9B;AAGO,SAAS,cAAc,WAAA,EAA6B;AACzD,EAAA,MAAM,SAAA,GAAY,YAAY,IAAA,EAAK,CAAE,MAAM,IAAI,CAAA,CAAE,CAAC,CAAA,IAAK,EAAA;AACvD,EAAA,MAAM,gBAAgB,SAAA,CAAU,KAAA,CAAM,cAAc,CAAA,CAAE,CAAC,CAAA,IAAK,SAAA;AAC5D,EAAA,OAAO,aAAA,CAAc,KAAA,CAAM,CAAA,EAAG,GAAG,CAAA;AACnC","file":"chunk-WOZTA5LS.js","sourcesContent":["import type { SupportKind, SupportStatus, SupportFilter, SupportEventType, SupportPriority } from '../types'\n\n// End-user text is pt-BR (AGENTS.md: only the end user's strings are pt-BR).\n// Never let a raw enum reach the screen — port-v2 régua de UX.\n\nexport const KIND_LABEL: Record<SupportKind, string> = {\n question: 'Dúvida',\n problem: 'Problema',\n improvement: 'Sugestão de melhoria',\n other: 'Outra solicitação',\n chat: 'Conversa com atendente',\n}\n\n/** The Tipo filter / select, in V1 order (Dúvida · Problema · Sugestão · Outra · Conversa). */\nexport const KIND_ORDER: SupportKind[] = ['question', 'problem', 'improvement', 'other', 'chat']\n\nexport const STATUS_LABEL: Record<SupportStatus, string> = {\n received: 'Recebida',\n triage: 'Recebida',\n in_service: 'Em atendimento',\n waiting_you: 'Aguardando você',\n in_development: 'Em desenvolvimento',\n resolved_check: 'Resolvida: confira',\n closed: 'Encerrada',\n cancelled: 'Cancelada',\n}\n\n// Badge tone per status, using the design system's Badge variants.\nexport type BadgeTone = 'default' | 'secondary' | 'success' | 'warning' | 'destructive' | 'outline'\n\n// Operator-side: priority (the helpdesk triages by it).\nexport const PRIORITY_LABEL: Record<SupportPriority, string> = {\n urgent: 'Crítica',\n high: 'Alta',\n normal: 'Normal',\n low: 'Baixa',\n}\n\nexport const PRIORITY_TONE: Record<SupportPriority, BadgeTone> = {\n urgent: 'destructive',\n high: 'warning',\n normal: 'secondary',\n low: 'outline',\n}\n\n/** Triage order: urgent first. */\nexport const PRIORITY_ORDER: SupportPriority[] = ['urgent', 'high', 'normal', 'low']\n\nexport const STATUS_TONE: Record<SupportStatus, BadgeTone> = {\n received: 'secondary',\n triage: 'secondary',\n in_service: 'default',\n waiting_you: 'warning',\n in_development: 'default',\n resolved_check: 'success',\n closed: 'outline',\n cancelled: 'outline',\n}\n\n// Which statuses each filter chip collects (central-de-suporte FLOW.md).\nexport const FILTER_STATUSES: Record<Exclude<SupportFilter, 'all'>, SupportStatus[]> = {\n waiting: ['waiting_you', 'resolved_check'],\n in_progress: ['received', 'triage', 'in_service', 'in_development'],\n closed: ['closed', 'cancelled'],\n}\n\nexport const FILTER_LABEL: Record<SupportFilter, string> = {\n waiting: 'Esperando você',\n in_progress: 'Em andamento',\n closed: 'Encerradas',\n all: 'Todas',\n}\n\n/** The statuses that still let the person write / attach. */\nexport function canMessage(status: SupportStatus): boolean {\n return !['closed', 'cancelled'].includes(status)\n}\n\n/** Cancel is only offered before the team picks it up. */\nexport function canCancel(status: SupportStatus): boolean {\n return status === 'received' || status === 'triage' || status === 'waiting_you'\n}\n\n/** \"Ficou bom / Ainda não resolveu\" replaces the message box here. */\nexport function canValidate(status: SupportStatus): boolean {\n return status === 'resolved_check'\n}\n\n// The four doors, in panel order. 'question' is the Dico chat, not a ticket.\nexport const DOORS: Array<{\n kind: SupportKind\n title: string\n hint: string\n icon: string\n}> = [\n { kind: 'problem', title: 'Reportar um problema', hint: 'Algo não funcionou como deveria', icon: 'Wrench' },\n { kind: 'improvement', title: 'Sugerir uma melhoria', hint: 'Conte o que faria seu dia mais fácil', icon: 'Lightbulb' },\n { kind: 'other', title: 'Outras solicitações', hint: 'Treinamento, acesso, dados, comercial', icon: 'MessageSquare' },\n]\n\n// The opening copy per door, matching the V1 form (central-de-suporte FLOW.md).\nexport const FORM_COPY: Record<SupportKind, { title: string; intro: string; subjectPlaceholder: string }> = {\n problem: {\n title: 'Reportar um problema',\n intro: 'Conte o que aconteceu. Uma captura da tela ajuda muito a gente a encontrar o problema.',\n subjectPlaceholder: 'Ex.: a comanda não imprime o nome da mesa',\n },\n improvement: {\n title: 'Sugerir uma melhoria',\n intro: 'O que faria o seu dia mais fácil no sistema? Toda sugestão é lida pela equipe.',\n subjectPlaceholder: 'Ex.: filtrar a agenda por sala',\n },\n other: {\n title: 'Outra solicitação',\n intro: 'Treinamento, acesso de usuários, importação de dados, assunto comercial: é por aqui.',\n subjectPlaceholder: 'Ex.: treinamento para a equipe nova',\n },\n // Not form doors in V2 (a doubt goes to the assistant; the live chat opens\n // from \"Conversar com um atendente\", support 020) — the copy exists so a\n // ticket of these kinds always has a title.\n question: {\n title: 'Tirar uma dúvida',\n intro: 'Conte o que você quer saber. A equipe responde por aqui.',\n subjectPlaceholder: 'Ex.: como cadastro um garçom?',\n },\n chat: {\n title: 'Conversa com atendente',\n intro: 'A conversa com o atendente fica registrada aqui.',\n subjectPlaceholder: 'Conversa com atendente',\n },\n}\n\nexport const EVENT_LABEL: Record<SupportEventType, string> = {\n opened: 'Solicitação aberta',\n status_changed: 'Andamento',\n validated_ok: 'Você confirmou que ficou bom',\n reopened: 'Reaberta: ainda não resolveu',\n cancelled: 'Andamento: Cancelada',\n closed_no_reply: 'Encerrada: sem resposta no prazo',\n merged: 'Unida a outra solicitação igual',\n assigned: 'Atribuída',\n priority_changed: 'Prioridade',\n marked_duplicate: 'Marcada como duplicata',\n bridge_refused: 'Não chegou ao V1',\n thread_started: 'Conversa iniciada',\n}\n\n/** The team's own history lines — the requester never reads them (support 005). */\nexport const TEAM_ONLY_EVENTS: ReadonlySet<SupportEventType> = new Set<SupportEventType>([\n 'assigned', 'priority_changed', 'marked_duplicate', 'bridge_refused', 'thread_started',\n])\n\n// ── the team's vocabulary (V1 /atendimento) ─────────────────────────────────\n// The operator reads the status with OTHER words than the requester (\"Em\n// triagem\", \"Aguardando cliente\", \"Resolvida\") — V1 FLOW.md, O vocabulário.\nexport const TEAM_STATUS_LABEL: Record<SupportStatus, string> = {\n received: 'Nova',\n triage: 'Em triagem',\n in_service: 'Em atendimento',\n waiting_you: 'Aguardando cliente',\n in_development: 'Em desenvolvimento',\n resolved_check: 'Resolvida',\n closed: 'Encerrada',\n cancelled: 'Cancelada',\n}\n\n/** The Andamento select, in V1 order. */\nexport const TEAM_STATUS_ORDER: SupportStatus[] = [\n 'received', 'triage', 'in_service', 'waiting_you', 'in_development', 'resolved_check', 'closed', 'cancelled',\n]\n\n/** The Prioridade select, in V1 order (Baixa · Normal · Alta · Crítica). */\nexport const TEAM_PRIORITY_ORDER: SupportPriority[] = ['low', 'normal', 'high', 'urgent']\n\n/** A history line as the TEAM reads it (V1: \"atribuída: Ana\", \"prioridade: Alta\"). */\nexport function teamEventLine(type: SupportEventType, note: string | null): string {\n switch (type) {\n case 'opened': return note ? `Aberta — ${note}` : 'Aberta'\n case 'status_changed': return `Andamento: ${note ? (TEAM_STATUS_LABEL[note as SupportStatus] ?? note) : '—'}`\n case 'assigned': return note ? `Atribuída: ${note}` : 'Responsável removido'\n case 'priority_changed': return `Prioridade: ${note ? (PRIORITY_LABEL[note as SupportPriority] ?? note) : '—'}`\n case 'marked_duplicate': return note ? `Marcada como duplicata de ${note}` : 'Marcada como duplicata'\n case 'validated_ok': return 'Cliente confirmou'\n case 'reopened': return note ? `Cliente reabriu: ${note}` : 'Cliente reabriu'\n case 'cancelled': return 'Andamento: Cancelada'\n case 'closed_no_reply': return 'Encerrada automaticamente'\n case 'merged': return EVENT_LABEL.merged\n case 'bridge_refused': return note ?? EVENT_LABEL.bridge_refused\n case 'thread_started': return note ? `Conversa iniciada na caixa de ${note}` : EVENT_LABEL.thread_started\n default: return EVENT_LABEL[type] ?? 'Atividade'\n }\n}\n\n/** The history line as shown: \"Andamento: Em atendimento\" etc. */\nexport function eventLine(type: SupportEventType, note: string | null): string {\n if (type === 'status_changed' && note) {\n const label = STATUS_LABEL[note as SupportStatus] ?? note\n return `Andamento: ${label}`\n }\n if (type === 'reopened' && note) return `Reaberta: ${note}`\n return EVENT_LABEL[type] ?? type\n}\n\n/** Subject fallback: first line/sentence of the description, capped at 200. */\nexport function deriveSubject(description: string): string {\n const firstLine = description.trim().split('\\n')[0] ?? ''\n const firstSentence = firstLine.split(/(?<=[.!?])\\s/)[0] ?? firstLine\n return firstSentence.slice(0, 200)\n}\n"]}