@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
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/data/provider.ts","../src/store.ts"],"names":[],"mappings":";;;;;AA+DO,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,MAAM,cAAA,CAAe,SAAA,EAAW,WAAA,EAAa;AAC3C,IAAA,IAAI,MAAA,GAAS,CAAA;AACb,IAAA,KAAA,MAAW,OAAA,IAAW,WAAA,CAAY,KAAA,CAAM,CAAA,EAAG,CAAC,CAAA,EAAG;AAC7C,MAAA,IAAI;AAAE,QAAA,MAAU,gBAAA,CAAiB,WAAW,OAAO,CAAA;AAAG,QAAA,MAAA,IAAU,CAAA;AAAA,MAAE,CAAA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ACjF,CAAA,EAAG,CAAC,EAAA,EAAI,OAAO,CAAC,CAAA;AAClB","file":"chunk-WHEJ63CM.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 /**\n * Files added to a request that is already open (the `+` of the assistant's\n * composer while it talks to the team). Optional: a provider without it keeps\n * the `+` off in that conversation. Resolves with how many landed.\n */\n addAttachments?(requestId: string, attachments: PendingAttachment[]): Promise<number>\n cancelRequest(requestId: string): Promise<void>\n /**\n * The person ends a live chat from their side (\"Encerrar\"), whoever took it.\n * Optional: without it the chat leaves the queue when nobody took it\n * (cancelRequest) and, past that, the team is told in the thread and closes it.\n */\n endChat?(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 async addAttachments(requestId, attachments) {\n let landed = 0\n for (const pending of attachments.slice(0, 8)) {\n try { await api.uploadAttachment(requestId, pending); landed += 1 } catch { /* the rest still go */ }\n }\n return landed\n },\n cancelRequest: api.cancelRequest,\n endChat: api.endChat,\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","import React from 'react'\nimport { create } from 'zustand'\nimport type {\n SupportRequest, SupportRequestDetail, SupportScope, SupportFilter,\n CreateSupportRequestInput, PendingAttachment,\n} from './types'\nimport { supportData } from './data/provider'\n\ninterface SupportState {\n requests: SupportRequest[]\n loadingList: boolean\n scope: SupportScope\n filter: SupportFilter\n\n selectedId: string | null\n detail: SupportRequestDetail | null\n loadingDetail: boolean\n\n unread: number\n\n setScope: (scope: SupportScope) => void\n setFilter: (filter: SupportFilter) => void\n loadList: () => Promise<void>\n select: (id: string | null) => Promise<void>\n refreshDetail: () => Promise<void>\n refreshUnread: () => Promise<void>\n\n create: (input: CreateSupportRequestInput, attachments: PendingAttachment[]) => Promise<{ id: string; number: number }>\n sendMessage: (body: string) => Promise<void>\n cancel: () => Promise<void>\n validate: (ok: boolean, reason?: string) => Promise<void>\n /** Back to the empty state (a host swapping its provider, a tenant switch). */\n reset: () => void\n}\n\nexport const useSupportStore = create<SupportState>((set, get) => ({\n requests: [],\n loadingList: false,\n scope: 'mine',\n filter: 'all',\n selectedId: null,\n detail: null,\n loadingDetail: false,\n unread: 0,\n\n setScope: (scope) => { set({ scope }); void get().loadList() },\n setFilter: (filter) => { set({ filter }); void get().loadList() },\n\n loadList: async () => {\n set({ loadingList: true })\n try {\n const requests = await supportData().listRequests(get().scope, get().filter)\n set({ requests })\n } finally {\n set({ loadingList: false })\n }\n },\n\n select: async (id) => {\n set({ selectedId: id, detail: null })\n if (!id) return\n set({ loadingDetail: true })\n try {\n const detail = await supportData().getRequestDetail(id)\n set({ detail })\n // Opening a request clears its \"esperando você\" notices.\n await supportData().markNotificationsRead(id)\n void get().refreshUnread()\n } finally {\n set({ loadingDetail: false })\n }\n },\n\n refreshDetail: async () => {\n const id = get().selectedId\n if (!id) return\n const detail = await supportData().getRequestDetail(id)\n set({ detail })\n },\n\n refreshUnread: async () => {\n set({ unread: await supportData().unreadCount() })\n },\n\n create: async (input, attachments) => {\n // The provider sends the attachments too (one failed file does not fail the request).\n const res = await supportData().createRequest(input, attachments)\n await get().loadList()\n return res\n },\n\n sendMessage: async (body) => {\n const id = get().selectedId\n if (!id || !body.trim()) return\n await supportData().addMessage(id, body)\n await get().refreshDetail()\n },\n\n cancel: async () => {\n const id = get().selectedId\n if (!id) return\n await supportData().cancelRequest(id)\n await Promise.all([get().refreshDetail(), get().loadList()])\n },\n\n validate: async (ok, reason) => {\n const id = get().selectedId\n if (!id) return\n await supportData().validateRequest(id, ok, reason)\n await Promise.all([get().refreshDetail(), get().loadList()])\n },\n\n reset: () => set({ requests: [], loadingList: false, scope: 'mine', filter: 'all', selectedId: null, detail: null, loadingDetail: false, unread: 0 }),\n}))\n\n/**\n * The team answers from the helpdesk inbox (/conversations or the ticket) —\n * another account, so nothing tells this screen. While a request is open and\n * the tab is visible, re-read it every 15s; stop when the tab hides.\n */\nexport function useLiveRequestDetail(id: string | null | undefined): void {\n const refresh = useSupportStore((s) => s.refreshDetail)\n React.useEffect(() => {\n if (!id || typeof document === 'undefined') return\n let timer: ReturnType<typeof setInterval> | null = null\n const every = supportData().pollMs?.detail ?? 15_000\n const start = () => { if (!timer) timer = setInterval(() => { void refresh().catch(() => {}) }, every) }\n const stop = () => { if (timer) { clearInterval(timer); timer = null } }\n const onVis = () => (document.visibilityState === 'visible' ? start() : stop())\n onVis()\n document.addEventListener('visibilitychange', onVis)\n return () => { stop(); document.removeEventListener('visibilitychange', onVis) }\n }, [id, refresh])\n}\n"]}
@@ -0,0 +1,261 @@
1
+ import { supportData, useSupportStore } from './chunk-WHEJ63CM.js';
2
+ import { isActiveChatStatus } from './chunk-S766CRAY.js';
3
+ import { getRecentActivity, useNavHistoryStore } from '@fayz-ai/core';
4
+
5
+ var takeTurnReportFiles = null;
6
+ var bridge = null;
7
+ function setSupportToolBridge(next) {
8
+ bridge = next;
9
+ takeTurnReportFiles = next?.takeTurnFiles ?? null;
10
+ }
11
+ function normalizeKind(raw) {
12
+ const s = String(raw ?? "").trim().toLowerCase();
13
+ if (["improvement", "melhoria", "sugestao", "sugest\xE3o", "suggestion"].some((k) => s.includes(k))) return "improvement";
14
+ if (["other", "outra", "outras", "outro", "solicitacao", "solicita\xE7\xE3o", "request"].some((k) => s.includes(k))) return "other";
15
+ return "problem";
16
+ }
17
+ function recentScreens(limit = 10) {
18
+ try {
19
+ const stack = useNavHistoryStore.getState().stack;
20
+ return stack.slice(-limit).reverse().map((e) => ({ path: e.path, label: e.label }));
21
+ } catch {
22
+ return [];
23
+ }
24
+ }
25
+ function currentRoute() {
26
+ if (typeof location === "undefined") return null;
27
+ return location.hash || location.pathname || null;
28
+ }
29
+ var SUPPORT_DOOR_SUGGESTIONS = [
30
+ { label: "Tirar d\xFAvida", prompt: "Tenho uma d\xFAvida", icon: "HelpCircle", action: "support.question" },
31
+ { label: "Reportar um problema", prompt: "Quero reportar um problema", icon: "Wrench", action: "support.report.problem" },
32
+ { label: "Sugerir uma melhoria", prompt: "Quero sugerir uma melhoria", icon: "Lightbulb", action: "support.report.improvement" },
33
+ { label: "Minhas solicita\xE7\xF5es", prompt: "Quero ver as minhas solicita\xE7\xF5es", icon: "Inbox", action: "support.my-requests" }
34
+ ];
35
+ var supportAITools = [
36
+ {
37
+ id: "support.report-issue",
38
+ name: "reportIssue",
39
+ description: `REGISTERS a support request (problema, melhoria ou outra solicita\xE7\xE3o) for the Fayz team. Use this the moment the user is REPORTING that something is wrong, asking for a change, or raising a request you cannot resolve from the app itself \u2014 "n\xE3o consigo\u2026", "deu erro", "n\xE3o aparece a op\xE7\xE3o de\u2026", "seria bom se\u2026". This is the ONLY correct action for a report: do NOT call any other tool to investigate or "fix" it (no payable/reconciliation/record tools) \u2014 a complaint is not a work order, and guessing at a fix does nothing the user asked for. Before registering: call findSupportRequests to check the issue is not ALREADY open (if it is, do not duplicate \u2014 point the user to that #number). Then lead in at most THREE short questions (for a problem: did it happen on the screen that is open? does it happen always?; for an improvement: how often would it help?), offer (do not require) a print \u2014 the + of the chat takes a print of the current screen \u2014 and call this with a clear description IN THE USER'S OWN WORDS, with the answers under it. It returns the request number and shows a card in the chat \u2014 tell the user "registrei a sua solicita\xE7\xE3o, n\xFAmero #N, a equipe vai acompanhar" and STOP. The route, the recent screens and the files of the turn are captured automatically; you do not pass them.`,
40
+ icon: "LifeBuoy",
41
+ mode: "persist",
42
+ // No confirmation card: the user already asked for it and the agent confirms
43
+ // in prose. The card would just show the technical params.
44
+ requiresConfirmation: false,
45
+ parameters: {
46
+ type: "object",
47
+ properties: {
48
+ kind: {
49
+ type: "string",
50
+ enum: ["problem", "improvement", "other"],
51
+ description: "problem = algo n\xE3o funcionou; improvement = sugest\xE3o de melhoria; other = treinamento, acesso, dados, comercial. Default problem."
52
+ },
53
+ description: {
54
+ type: "string",
55
+ description: "O que aconteceu, na linguagem do usu\xE1rio: o que ele fazia, o que esperava e o que apareceu."
56
+ },
57
+ subject: {
58
+ type: "string",
59
+ description: "Opcional. Um t\xEDtulo curto para a solicita\xE7\xE3o."
60
+ }
61
+ },
62
+ required: ["description"]
63
+ },
64
+ category: "Suporte",
65
+ suggestions: SUPPORT_DOOR_SUGGESTIONS
66
+ },
67
+ {
68
+ id: "support.find-requests",
69
+ name: "findSupportRequests",
70
+ description: 'Lists the user\'s support requests (solicita\xE7\xF5es). CALL THIS BEFORE registering a problem or improvement, to check whether the same thing is ALREADY reported (show=false). If an open request clearly covers the same issue, do NOT open a duplicate: tell the user it is already registered (give the #number and its status) and offer to add a note to it instead. When the user asks to SEE their requests ("minhas solicita\xE7\xF5es", "como est\xE1 meu chamado"), call it with show=true: the chat shows them as a card the user can open. Optional `query` filters by words from the user\'s complaint.',
71
+ icon: "Search",
72
+ mode: "read",
73
+ parameters: {
74
+ type: "object",
75
+ properties: {
76
+ query: { type: "string", description: "Palavras do que o usu\xE1rio est\xE1 relatando, para achar uma solicita\xE7\xE3o parecida. Opcional." },
77
+ show: { type: "boolean", description: "true = o usu\xE1rio pediu para VER as solicita\xE7\xF5es: o chat mostra a lista num cart\xE3o." }
78
+ }
79
+ },
80
+ category: "Suporte"
81
+ },
82
+ {
83
+ id: "support.start-live-chat",
84
+ name: "startLiveChat",
85
+ description: 'Hands THIS conversation to a person of the support team (chat ao vivo), with everything said so far. Use it when the user asks for a human ("quero falar com algu\xE9m", "chama um atendente", "falar com o suporte") or when you cannot help and they want a person. The chat itself switches to the team \u2014 do not navigate anywhere. If nobody is online it says so and the user can leave a message (then use reportIssue with kind=other). After calling it, say in ONE short sentence that the team was called, and stop.',
86
+ icon: "Headset",
87
+ mode: "persist",
88
+ requiresConfirmation: false,
89
+ parameters: { type: "object", properties: { reason: { type: "string", description: "Opcional. Em uma frase, o que a pessoa precisa." } } },
90
+ category: "Suporte"
91
+ },
92
+ {
93
+ id: "support.open-request",
94
+ name: "openSupportRequest",
95
+ description: "Opens ONE of the user's support requests inside the chat, by its number (#N): its status and the conversation with the team, where the user can reply. A live chat that is still open goes back to the conversation with the team. Use it when the user asks about a specific request.",
96
+ icon: "Inbox",
97
+ mode: "read",
98
+ parameters: {
99
+ type: "object",
100
+ properties: { number: { type: "number", description: "O n\xFAmero da solicita\xE7\xE3o (#N)." } },
101
+ required: ["number"]
102
+ },
103
+ category: "Suporte"
104
+ }
105
+ ];
106
+ function toPending(file) {
107
+ return {
108
+ id: globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random().toString(16).slice(2)}`,
109
+ file,
110
+ name: file.name || "anexo",
111
+ contentType: file.type || "application/octet-stream",
112
+ sizeBytes: file.size
113
+ };
114
+ }
115
+ async function createSupportRequest(input) {
116
+ const files = input.files ?? [];
117
+ const res = await supportData().createRequest({
118
+ kind: input.kind,
119
+ description: input.description,
120
+ subject: input.subject ?? null,
121
+ route: input.route === void 0 ? currentRoute() : input.route,
122
+ // What the user was doing travels with the request, so the team reads it
123
+ // without a second round-trip. `activity` is the rich trail (routes +
124
+ // buttons pressed); `recentScreens` stays for tickets opened before it.
125
+ screenSnapshot: { activity: safeActivity(), recentScreens: recentScreens(), origin: "assistant", ...input.snapshot }
126
+ }, files.map(toPending));
127
+ try {
128
+ void useSupportStore.getState().loadList();
129
+ } catch {
130
+ }
131
+ return res;
132
+ }
133
+ function safeActivity() {
134
+ try {
135
+ return getRecentActivity(10);
136
+ } catch {
137
+ return [];
138
+ }
139
+ }
140
+ async function executeReportIssue(args) {
141
+ const description = String(args.description ?? "").trim();
142
+ if (description.length < 5) {
143
+ return {
144
+ ok: false,
145
+ error: "missing_description",
146
+ message: "Antes de registrar, pergunte ao usu\xE1rio o que aconteceu e descreva com as palavras dele (m\xEDnimo de uma frase)."
147
+ };
148
+ }
149
+ const kind = normalizeKind(args.kind);
150
+ const subject = typeof args.subject === "string" && args.subject.trim() ? args.subject.trim() : null;
151
+ const files = takeTurnReportFiles ? takeTurnReportFiles() : [];
152
+ try {
153
+ const res = await createSupportRequest({ kind, description, subject, files });
154
+ return {
155
+ ok: true,
156
+ id: res.id,
157
+ number: res.number,
158
+ status: "received",
159
+ attachments: files.length,
160
+ chatWidget: { type: "support.request-result", props: { id: res.id, number: res.number, kind, attachments: files.length } },
161
+ message: `Solicita\xE7\xE3o #${res.number} registrada${files.length ? ` com ${files.length} anexo(s)` : ""}. Diga ao usu\xE1rio o n\xFAmero e que a equipe vai acompanhar. N\xC3O chame mais nenhuma ferramenta \u2014 o relato est\xE1 registrado.`
162
+ };
163
+ } catch (error) {
164
+ return {
165
+ ok: false,
166
+ error: "write_failed",
167
+ message: error instanceof Error ? error.message : "N\xE3o consegui registrar a solicita\xE7\xE3o."
168
+ };
169
+ }
170
+ }
171
+ function isOpen(status) {
172
+ return status !== "closed" && status !== "cancelled";
173
+ }
174
+ async function executeFindRequests(args) {
175
+ const query = String(args.query ?? "").trim().toLowerCase();
176
+ const show = args.show === true || args.show === "true";
177
+ const terms = query.split(/[^\p{L}\p{N}]+/u).filter((w) => w.length > 2);
178
+ let all;
179
+ try {
180
+ all = await supportData().listRequests("mine", "all");
181
+ } catch (error) {
182
+ return { error: "read_failed", message: error instanceof Error ? error.message : "N\xE3o consegui ler as solicita\xE7\xF5es." };
183
+ }
184
+ const requests = all.filter((r) => r.kind !== "chat");
185
+ const pool = show ? requests : requests.filter((r) => isOpen(r.status));
186
+ const scored = pool.map((r) => {
187
+ const hay = `${r.subject ?? ""} ${r.description}`.toLowerCase();
188
+ const score = terms.length ? terms.filter((t) => hay.includes(t)).length : 0;
189
+ return { r, score };
190
+ }).sort((a, b) => b.score - a.score || b.r.number - a.r.number);
191
+ const picked = (terms.length ? scored.filter((s) => s.score > 0) : scored).slice(0, show ? 8 : 10);
192
+ const items = picked.map(({ r }) => ({
193
+ id: r.id,
194
+ number: r.number,
195
+ kind: r.kind,
196
+ subject: r.subject || r.description.slice(0, 80),
197
+ status: r.status
198
+ }));
199
+ return {
200
+ total: picked.length,
201
+ openTotal: requests.filter((r) => isOpen(r.status)).length,
202
+ requests: items.map((i, idx) => ({ ...i, createdAt: picked[idx].r.createdAt })),
203
+ ...show ? { chatWidget: { type: "support.requests-list", props: { items } } } : {},
204
+ hint: show ? "The chat already shows these as a card the user can open \u2014 answer in one sentence, do not list them again." : picked.length ? "If one of these is clearly the SAME issue the user is reporting now, do not open a duplicate \u2014 say it is already registered (#number + status) and offer to add a note." : "Nothing similar is open \u2014 go ahead and register the new request."
205
+ };
206
+ }
207
+ async function executeStartLiveChat() {
208
+ if (!bridge) return { ok: false, error: "unavailable", message: "O atendimento ao vivo n\xE3o est\xE1 dispon\xEDvel aqui. Ofere\xE7a registrar uma solicita\xE7\xE3o (reportIssue)." };
209
+ const r = await bridge.startLiveChat();
210
+ if (r.ok) {
211
+ return { ok: true, number: r.number, message: "A conversa passou para a equipe de suporte, aqui mesmo no chat. Diga isso em uma frase curta e pare." };
212
+ }
213
+ return {
214
+ ok: false,
215
+ reason: r.reason,
216
+ message: r.reason === "nobody_online" ? "Ningu\xE9m da equipe est\xE1 online agora; o chat j\xE1 ofereceu deixar um recado. Se a pessoa contar o que precisa, registre com reportIssue (kind=other)." : "N\xE3o consegui chamar a equipe agora. Ofere\xE7a registrar uma solicita\xE7\xE3o (reportIssue)."
217
+ };
218
+ }
219
+ async function executeOpenRequest(args) {
220
+ const number = Number(String(args.number ?? "").replace(/\D/g, ""));
221
+ if (!number) return { ok: false, error: "missing_number", message: "Pergunte o n\xFAmero da solicita\xE7\xE3o (#N)." };
222
+ let rows;
223
+ try {
224
+ rows = await supportData().listRequests("mine", "all");
225
+ } catch (error) {
226
+ return { ok: false, error: "read_failed", message: error instanceof Error ? error.message : "N\xE3o consegui ler as solicita\xE7\xF5es." };
227
+ }
228
+ const r = rows.find((x) => x.number === number);
229
+ if (!r) return { ok: false, error: "not_found", message: `N\xE3o achei a solicita\xE7\xE3o #${number} entre as do usu\xE1rio.` };
230
+ if (r.kind === "chat" && isActiveChatStatus(r.status) && bridge) {
231
+ bridge.resumeChat(r.id, r.number);
232
+ return { ok: true, number, message: "A conversa ao vivo foi retomada aqui no chat. Diga isso em uma frase e pare." };
233
+ }
234
+ return {
235
+ ok: true,
236
+ number,
237
+ status: r.status,
238
+ chatWidget: { type: "support.request-thread", props: { id: r.id } },
239
+ message: "O chat mostra a solicita\xE7\xE3o num cart\xE3o (status e conversa, com resposta). Resuma o status em uma frase."
240
+ };
241
+ }
242
+ var supportToolHandlers = {
243
+ reportIssue: executeReportIssue,
244
+ findSupportRequests: executeFindRequests,
245
+ startLiveChat: () => executeStartLiveChat(),
246
+ openSupportRequest: executeOpenRequest
247
+ };
248
+ var registered = false;
249
+ function registerSupportAITools() {
250
+ if (registered || typeof document === "undefined") return;
251
+ registered = true;
252
+ void import('./in-chat-install-2BTKBF2Z.js').then((m) => {
253
+ m.installSupportInChat();
254
+ }).catch(() => {
255
+ registered = false;
256
+ });
257
+ }
258
+
259
+ export { SUPPORT_DOOR_SUGGESTIONS, createSupportRequest, registerSupportAITools, setSupportToolBridge, supportAITools, supportToolHandlers };
260
+ //# sourceMappingURL=chunk-Y673XGDK.js.map
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AA,EACtG,WAAA,EAAa,kBAAA;AAAA,EACb,mBAAA,EAAqB,mBAAA;AAAA,EACrB,aAAA,EAAe,MAAM,oBAAA,EAAqB;AAAA,EAC1C,kBAAA,EAAoB;AACtB;AAEA,IAAI,UAAA,GAAa,KAAA;AAUV,SAAS,sBAAA,GAA+B;AAC7C,EAAA,IAAI,UAAA,IAAc,OAAO,QAAA,KAAa,WAAA,EAAa;AACnD,EAAA,UAAA,GAAa,IAAA;AACb,EAAA,KAAK,OAAO,+BAA6B,CAAA,CACtC,IAAA,CAAK,CAAC,CAAA,KAAM;AAAE,IAAA,CAAA,CAAE,oBAAA,EAAqB;AAAA,EAAE,CAAC,CAAA,CACxC,KAAA,CAAM,MAAM;AAGX,IAAA,UAAA,GAAa,KAAA;AAAA,EACf,CAAC,CAAA;AACL","file":"chunk-Y673XGDK.js","sourcesContent":["import { useNavHistoryStore, getRecentActivity } from '@fayz-ai/core'\nimport type { PluginAITool } from '@fayz-ai/core'\nimport { supportData } from '../data/provider'\nimport { useSupportStore } from '../store'\nimport { isActiveChatStatus } from '../livechat/rules'\nimport type { PendingAttachment, SupportKind } from '../types'\n\n// Set once admin is loaded (installSupportInChat) — the images/PDFs the chat\n// turn carried, so a print the user dropped reaches the ticket, not just the LLM.\nlet takeTurnReportFiles: (() => File[]) | null = null\n\n/** What the tools need from the in-chat mode (the live chat, the cards). Set by installSupportInChat. */\nexport interface SupportToolBridge {\n takeTurnFiles: () => File[]\n startLiveChat: () => Promise<{ ok: boolean; number?: number; reason?: string }>\n resumeChat: (id: string, number: number) => void\n}\nlet bridge: SupportToolBridge | null = null\nexport function setSupportToolBridge(next: SupportToolBridge | null): void {\n bridge = next\n takeTurnReportFiles = next?.takeTurnFiles ?? null\n}\n\n// ---------------------------------------------------------------------------\n// \"Modo relato\" — the Dico registers a support request instead of trying to\n// FIX the problem with whatever tool is lying around.\n//\n// The bug this exists to kill: told \"when I try to reconcile, it won't let me\n// create a supplier\", gpt-4o-mini treated it as a task and called a random\n// payable tool (\"Resolve Payable Context\") — doing nothing the user asked for.\n// A complaint is not a work order. So this tool is a DEAD END on purpose: it\n// writes the request, returns the number, and its description forbids every\n// other tool. The behaviour is driven from BOTH ends — this description and the\n// agent's provisioned instructions (\"report mode\").\n// ---------------------------------------------------------------------------\n\n/** Map whatever the model sends to one of the three ticket kinds. A plain\n * question (\"tenho uma dúvida\") is NOT a ticket — the agent just answers it. */\nfunction normalizeKind(raw: unknown): SupportKind {\n const s = String(raw ?? '').trim().toLowerCase()\n if (['improvement', 'melhoria', 'sugestao', 'sugestão', 'suggestion'].some((k) => s.includes(k))) return 'improvement'\n if (['other', 'outra', 'outras', 'outro', 'solicitacao', 'solicitação', 'request'].some((k) => s.includes(k))) return 'other'\n // Everything else — including \"problem\"/\"problema\"/\"bug\"/\"erro\" — is a problem.\n return 'problem'\n}\n\n/** The last screens the user passed through, newest first. Read from the global\n * nav-history ring buffer the app shell fills on every route change. */\nfunction recentScreens(limit = 10): Array<{ path: string; label: string }> {\n try {\n const stack = useNavHistoryStore.getState().stack\n return stack.slice(-limit).reverse().map((e) => ({ path: e.path, label: e.label }))\n } catch {\n return []\n }\n}\n\n/** The route the user is on right now, as the V1 form records it. */\nfunction currentRoute(): string | null {\n if (typeof location === 'undefined') return null\n return location.hash || location.pathname || null\n}\n\n/** The support menu's doors, as chips (each with its own icon and a deterministic\n * path — admin `registerChatAction`; with nothing registered they send `prompt`). */\n//\n// The doors the ASSISTANT leads (a question, a problem, an improvement) plus the\n// list. Not here, on purpose:\n// * \"Falar com um atendente\" — the header's support button is that door (and\n// shows the conversation while it runs); a chip saying the same was two\n// ways to one place.\n// * \"Outras solicitações\" — out of the welcome (owner, 28/10). The action\n// `support.report.other` stays registered (the V1's openSupport('other'),\n// \"Deixar recado\"), and reportIssue still takes kind 'other' from the model.\nexport const SUPPORT_DOOR_SUGGESTIONS = [\n { label: 'Tirar dúvida', prompt: 'Tenho uma dúvida', icon: 'HelpCircle', action: 'support.question' },\n { label: 'Reportar um problema', prompt: 'Quero reportar um problema', icon: 'Wrench', action: 'support.report.problem' },\n { label: 'Sugerir uma melhoria', prompt: 'Quero sugerir uma melhoria', icon: 'Lightbulb', action: 'support.report.improvement' },\n { label: 'Minhas solicitações', prompt: 'Quero ver as minhas solicitações', icon: 'Inbox', action: 'support.my-requests' },\n]\n\nexport const supportAITools: PluginAITool[] = [\n {\n id: 'support.report-issue',\n name: 'reportIssue',\n description:\n 'REGISTERS a support request (problema, melhoria ou outra solicitação) for the Fayz team. ' +\n 'Use this the moment the user is REPORTING that something is wrong, asking for a change, or raising a request you cannot resolve from the app itself — \"não consigo…\", \"deu erro\", \"não aparece a opção de…\", \"seria bom se…\". ' +\n 'This is the ONLY correct action for a report: do NOT call any other tool to investigate or \"fix\" it (no payable/reconciliation/record tools) — a complaint is not a work order, and guessing at a fix does nothing the user asked for. ' +\n 'Before registering: call findSupportRequests to check the issue is not ALREADY open (if it is, do not duplicate — point the user to that #number). Then lead in at most THREE short questions (for a problem: did it happen on the screen that is open? does it happen always?; for an improvement: how often would it help?), offer (do not require) a print — the + of the chat takes a print of the current screen — and call this with a clear description IN THE USER\\'S OWN WORDS, with the answers under it. ' +\n 'It returns the request number and shows a card in the chat — tell the user \"registrei a sua solicitação, número #N, a equipe vai acompanhar\" and STOP. The route, the recent screens and the files of the turn are captured automatically; you do not pass them.',\n icon: 'LifeBuoy',\n mode: 'persist',\n // No confirmation card: the user already asked for it and the agent confirms\n // in prose. The card would just show the technical params.\n requiresConfirmation: false,\n parameters: {\n type: 'object',\n properties: {\n kind: {\n type: 'string',\n enum: ['problem', 'improvement', 'other'],\n description: 'problem = algo não funcionou; improvement = sugestão de melhoria; other = treinamento, acesso, dados, comercial. Default problem.',\n },\n description: {\n type: 'string',\n description: 'O que aconteceu, na linguagem do usuário: o que ele fazia, o que esperava e o que apareceu.',\n },\n subject: {\n type: 'string',\n description: 'Opcional. Um título curto para a solicitação.',\n },\n },\n required: ['description'],\n },\n category: 'Suporte',\n suggestions: SUPPORT_DOOR_SUGGESTIONS,\n },\n {\n id: 'support.find-requests',\n name: 'findSupportRequests',\n description:\n 'Lists the user\\'s support requests (solicitações). ' +\n 'CALL THIS BEFORE registering a problem or improvement, to check whether the same thing is ALREADY reported (show=false). ' +\n 'If an open request clearly covers the same issue, do NOT open a duplicate: tell the user it is already registered (give the #number and its status) and offer to add a note to it instead. ' +\n 'When the user asks to SEE their requests (\"minhas solicitações\", \"como está meu chamado\"), call it with show=true: the chat shows them as a card the user can open. ' +\n 'Optional `query` filters by words from the user\\'s complaint.',\n icon: 'Search',\n mode: 'read',\n parameters: {\n type: 'object',\n properties: {\n query: { type: 'string', description: 'Palavras do que o usuário está relatando, para achar uma solicitação parecida. Opcional.' },\n show: { type: 'boolean', description: 'true = o usuário pediu para VER as solicitações: o chat mostra a lista num cartão.' },\n },\n },\n category: 'Suporte',\n },\n {\n id: 'support.start-live-chat',\n name: 'startLiveChat',\n description:\n 'Hands THIS conversation to a person of the support team (chat ao vivo), with everything said so far. ' +\n 'Use it when the user asks for a human (\"quero falar com alguém\", \"chama um atendente\", \"falar com o suporte\") or when you cannot help and they want a person. ' +\n 'The chat itself switches to the team — do not navigate anywhere. If nobody is online it says so and the user can leave a message (then use reportIssue with kind=other). ' +\n 'After calling it, say in ONE short sentence that the team was called, and stop.',\n icon: 'Headset',\n mode: 'persist',\n requiresConfirmation: false,\n parameters: { type: 'object', properties: { reason: { type: 'string', description: 'Opcional. Em uma frase, o que a pessoa precisa.' } } },\n category: 'Suporte',\n },\n {\n id: 'support.open-request',\n name: 'openSupportRequest',\n description:\n 'Opens ONE of the user\\'s support requests inside the chat, by its number (#N): its status and the conversation with the team, where the user can reply. ' +\n 'A live chat that is still open goes back to the conversation with the team. Use it when the user asks about a specific request.',\n icon: 'Inbox',\n mode: 'read',\n parameters: {\n type: 'object',\n properties: { number: { type: 'number', description: 'O número da solicitação (#N).' } },\n required: ['number'],\n },\n category: 'Suporte',\n },\n]\n\nexport interface ReportIssueResult {\n ok: boolean\n id?: string\n number?: number\n status?: string\n attachments?: number\n message?: string\n error?: string\n chatWidget?: { type: string; props: Record<string, unknown> }\n}\n\nfunction toPending(file: File): PendingAttachment {\n return {\n id: globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random().toString(16).slice(2)}`,\n file,\n name: file.name || 'anexo',\n contentType: file.type || 'application/octet-stream',\n sizeBytes: file.size,\n }\n}\n\n/** Client-plane executor. Writes the request through the support data port\n * (`supportData()` — the platform's RPCs, or a host's provider: the V1's edge),\n * attaches the files of the turn and hands back the number plus the card the\n * chat shows (\"Solicitação #N registrada\"). */\n/** One request through the support data port, with what the person attached: what every path registers through. */\nexport async function createSupportRequest(input: {\n kind: SupportKind\n description: string\n subject?: string | null\n files?: File[]\n route?: string | null\n snapshot?: Record<string, unknown>\n}): Promise<{ id: string; number: number }> {\n const files = input.files ?? []\n const res = await supportData().createRequest({\n kind: input.kind,\n description: input.description,\n subject: input.subject ?? null,\n route: input.route === undefined ? currentRoute() : input.route,\n // What the user was doing travels with the request, so the team reads it\n // without a second round-trip. `activity` is the rich trail (routes +\n // buttons pressed); `recentScreens` stays for tickets opened before it.\n screenSnapshot: { activity: safeActivity(), recentScreens: recentScreens(), origin: 'assistant', ...input.snapshot },\n }, files.map(toPending))\n // The list behind the chat (\"Minhas solicitações\") refreshes now, not on reload.\n try { void useSupportStore.getState().loadList() } catch { /* the screen may not be mounted */ }\n return res\n}\n\nfunction safeActivity(): unknown {\n try { return getRecentActivity(10) } catch { return [] }\n}\n\nexport async function executeReportIssue(args: Record<string, unknown>): Promise<ReportIssueResult> {\n const description = String(args.description ?? '').trim()\n if (description.length < 5) {\n return {\n ok: false,\n error: 'missing_description',\n message: 'Antes de registrar, pergunte ao usuário o que aconteceu e descreva com as palavras dele (mínimo de uma frase).',\n }\n }\n const kind = normalizeKind(args.kind)\n const subject = typeof args.subject === 'string' && args.subject.trim() ? args.subject.trim() : null\n const files = takeTurnReportFiles ? takeTurnReportFiles() : []\n try {\n const res = await createSupportRequest({ kind, description, subject, files })\n return {\n ok: true,\n id: res.id,\n number: res.number,\n status: 'received',\n attachments: files.length,\n chatWidget: { type: 'support.request-result', props: { id: res.id, number: res.number, kind, attachments: files.length } },\n message:\n `Solicitação #${res.number} registrada${files.length ? ` com ${files.length} anexo(s)` : ''}. ` +\n 'Diga ao usuário o número e que a equipe vai acompanhar. ' +\n 'NÃO chame mais nenhuma ferramenta — o relato está registrado.',\n }\n } catch (error) {\n return {\n ok: false,\n error: 'write_failed',\n message: error instanceof Error ? error.message : 'Não consegui registrar a solicitação.',\n }\n }\n}\n\n/** Open = still actionable (not closed/cancelled). The dedup check only cares\n * about requests the team could still be working on. */\nfunction isOpen(status: string): boolean {\n return status !== 'closed' && status !== 'cancelled'\n}\n\n/** Read-plane executor: the user's requests, ranked by how well they match the\n * complaint, so the agent can see \"this is already #N\" before duplicating —\n * and, asked to SHOW them, the card with the list. */\nexport async function executeFindRequests(args: Record<string, unknown>): Promise<unknown> {\n const query = String(args.query ?? '').trim().toLowerCase()\n const show = args.show === true || args.show === 'true'\n const terms = query.split(/[^\\p{L}\\p{N}]+/u).filter((w) => w.length > 2)\n let all\n try {\n all = await supportData().listRequests('mine', 'all')\n } catch (error) {\n return { error: 'read_failed', message: error instanceof Error ? error.message : 'Não consegui ler as solicitações.' }\n }\n // A live chat is a conversation, not a request: never listed, never a duplicate.\n const requests = all.filter((r) => r.kind !== 'chat')\n const pool = show ? requests : requests.filter((r) => isOpen(r.status))\n const scored = pool\n .map((r) => {\n const hay = `${r.subject ?? ''} ${r.description}`.toLowerCase()\n const score = terms.length ? terms.filter((t) => hay.includes(t)).length : 0\n return { r, score }\n })\n .sort((a, b) => b.score - a.score || b.r.number - a.r.number)\n const picked = (terms.length ? scored.filter((s) => s.score > 0) : scored).slice(0, show ? 8 : 10)\n const items = picked.map(({ r }) => ({\n id: r.id, number: r.number, kind: r.kind, subject: r.subject || r.description.slice(0, 80), status: r.status,\n }))\n return {\n total: picked.length,\n openTotal: requests.filter((r) => isOpen(r.status)).length,\n requests: items.map((i, idx) => ({ ...i, createdAt: picked[idx]!.r.createdAt })),\n ...(show ? { chatWidget: { type: 'support.requests-list', props: { items } } } : {}),\n hint: show\n ? 'The chat already shows these as a card the user can open — answer in one sentence, do not list them again.'\n : picked.length\n ? 'If one of these is clearly the SAME issue the user is reporting now, do not open a duplicate — say it is already registered (#number + status) and offer to add a note.'\n : 'Nothing similar is open — go ahead and register the new request.',\n }\n}\n\nexport async function executeStartLiveChat(): Promise<unknown> {\n if (!bridge) return { ok: false, error: 'unavailable', message: 'O atendimento ao vivo não está disponível aqui. Ofereça registrar uma solicitação (reportIssue).' }\n const r = await bridge.startLiveChat()\n if (r.ok) {\n return { ok: true, number: r.number, message: 'A conversa passou para a equipe de suporte, aqui mesmo no chat. Diga isso em uma frase curta e pare.' }\n }\n return {\n ok: false,\n reason: r.reason,\n message: r.reason === 'nobody_online'\n ? 'Ninguém da equipe está online agora; o chat já ofereceu deixar um recado. Se a pessoa contar o que precisa, registre com reportIssue (kind=other).'\n : 'Não consegui chamar a equipe agora. Ofereça registrar uma solicitação (reportIssue).',\n }\n}\n\nexport async function executeOpenRequest(args: Record<string, unknown>): Promise<unknown> {\n const number = Number(String(args.number ?? '').replace(/\\D/g, ''))\n if (!number) return { ok: false, error: 'missing_number', message: 'Pergunte o número da solicitação (#N).' }\n let rows\n try {\n rows = await supportData().listRequests('mine', 'all')\n } catch (error) {\n return { ok: false, error: 'read_failed', message: error instanceof Error ? error.message : 'Não consegui ler as solicitações.' }\n }\n const r = rows.find((x) => x.number === number)\n if (!r) return { ok: false, error: 'not_found', message: `Não achei a solicitação #${number} entre as do usuário.` }\n if (r.kind === 'chat' && isActiveChatStatus(r.status) && bridge) {\n bridge.resumeChat(r.id, r.number)\n return { ok: true, number, message: 'A conversa ao vivo foi retomada aqui no chat. Diga isso em uma frase e pare.' }\n }\n return {\n ok: true,\n number,\n status: r.status,\n chatWidget: { type: 'support.request-thread', props: { id: r.id } },\n message: 'O chat mostra a solicitação num cartão (status e conversa, com resposta). Resuma o status em uma frase.',\n }\n}\n\n/** Executors by tool name — what a host registers (the V1 brain calls them through its panel). */\nexport const supportToolHandlers: Record<string, (args: Record<string, unknown>) => Promise<unknown>> = {\n reportIssue: executeReportIssue,\n findSupportRequests: executeFindRequests,\n startLiveChat: () => executeStartLiveChat(),\n openSupportRequest: executeOpenRequest,\n}\n\nlet registered = false\n\n/**\n * Register the client-plane executors and the in-chat mode (chips, cards, the\n * \"Atendente\" hand-off).\n *\n * Done through a DYNAMIC import, guarded to the browser, so building the\n * manifest (and unit-testing it) never pulls the admin React chain — the same\n * reason index.ts lazy-loads the views. Idempotent.\n */\nexport function registerSupportAITools(): void {\n if (registered || typeof document === 'undefined') return\n registered = true\n void import('../livechat/in-chat-install')\n .then((m) => { m.installSupportInChat() })\n .catch(() => {\n // An app with no assistant wired never calls the tool — a failed register\n // must not break the plugin's screens.\n registered = false\n })\n}\n"]}
@@ -12,6 +12,11 @@ export declare function uploadAttachment(requestId: string, pending: PendingAtta
12
12
  * falls back to the old table only where there is no inbox to unify with. */
13
13
  export declare function addMessage(requestId: string, body: string): Promise<void>;
14
14
  export declare function cancelRequest(requestId: string): Promise<void>;
15
+ /**
16
+ * "Encerrar" by the person who asked: the live chat is over from their side,
17
+ * taken or not (the requester's own row — same direct write as cancel/validate).
18
+ */
19
+ export declare function endChat(requestId: string): Promise<void>;
15
20
  export declare function validateRequest(requestId: string, ok: boolean, reason?: string): Promise<void>;
16
21
  export declare function markNotificationsRead(requestId: string): Promise<void>;
17
22
  export declare function signedUrl(storagePath: string, expiresIn?: number): Promise<string | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/data/api.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,cAAc,EAAE,KAAK,oBAAoB,EAC3B,KAAK,iBAAiB,EAAE,KAAK,yBAAyB,EACzE,KAAK,iBAAiB,EAAE,KAAK,YAAY,EAAE,K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AI,CAAC,CAI5F"}
@@ -58,6 +58,8 @@ export interface ConsoleDetail extends ConsoleRequest {
58
58
  /** 'v1' = a V1 house's ticket (support 011); `externalLicenseId` is its V1 license number. */
59
59
  origin: TicketOrigin;
60
60
  externalLicenseId: number | null;
61
+ /** support 040: when the V1 ticket came by the migration (not the bridge); null otherwise. */
62
+ importedAt: string | null;
61
63
  notes: ConsoleNote[];
62
64
  /** The messages from BEFORE the unification (plg_support_request_messages),
63
65
  * read-only. The live conversation is the inbox thread (`thread`). */
@@ -135,6 +137,8 @@ export interface BoardTicket {
135
137
  /** 'v1' = a V1 house's ticket over the bridge (support 011): `number` is the V1
136
138
  * number the requester cites, and replies/status go back to the V1. */
137
139
  origin: TicketOrigin;
140
+ /** support 040: came by the migration of the V1 history ("migrado do V1"). */
141
+ imported?: boolean;
138
142
  }
139
143
  /** Where a ticket was opened: this pool (v2) or a V1 house over the bridge. */
140
144
  export type TicketOrigin = 'v2' | 'v1';
@@ -144,6 +148,8 @@ export interface BoardLoad {
144
148
  * RPC gives (no owner, no first reply) and hides the actions that need 005. */
145
149
  full: boolean;
146
150
  }
151
+ /** support 040: the ids of the imported V1 tickets on the board. Before 040 (or on any error): none — the seal is cosmetic. */
152
+ export declare function consoleImportedIds(): Promise<string[]>;
147
153
  /** Open tickets + closed/cancelled with activity in the last 14 days (V1 listBoard). */
148
154
  export declare function consoleBoard(): Promise<BoardLoad>;
149
155
  export interface ConsoleAgent {
@@ -1 +1 @@
1
- {"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../src/data/console.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EAAE,aAAa,EAAE,eAAe,EAC3C,cAAc,EAAE,YAAY,EAAE,iBAAiB,EAChD,MAAM,UAAU,CAAA;AAejB,mFAAmF;AACnF,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,WAAW,CAAA;IACjB,OAAO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I,CAAA;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AACD,MAAM,MAAM,iBAAiB,GACzB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAClE;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAEhD;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAiCvF"}
@@ -1 +1 @@
1
- {"version":3,"file":"mock-host.d.ts","sourceRoot":"","sources":["../../src/data/mock-host.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAE3D,MAAM,WAAW,mBAAmB;IAClC,mCAAmC;IACnC,EAAE,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACjC,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,sGAAsG;IACtG,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,oDAAoD;IACpD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AASD,wBAAgB,8BAA8B,CAAC,IAAI,GAAE,mBAAwB,GAAG,oBAAoB,CAqInG"}
1
+ {"version":3,"file":"mock-host.d.ts","sourceRoot":"","sources":["../../src/data/mock-host.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAE3D,MAAM,WAAW,mBAAmB;IAClC,mCAAmC;IACnC,EAAE,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACjC,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,sGAAsG;IACtG,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,oDAAoD;IACpD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AASD,wBAAgB,8BAA8B,CAAC,IAAI,GAAE,mBAAwB,GAAG,oBAAoB,CA2InG"}
@@ -19,7 +19,19 @@ export interface SupportDataProvider {
19
19
  number: number;
20
20
  }>;
21
21
  addMessage(requestId: string, body: string): Promise<void>;
22
+ /**
23
+ * Files added to a request that is already open (the `+` of the assistant's
24
+ * composer while it talks to the team). Optional: a provider without it keeps
25
+ * the `+` off in that conversation. Resolves with how many landed.
26
+ */
27
+ addAttachments?(requestId: string, attachments: PendingAttachment[]): Promise<number>;
22
28
  cancelRequest(requestId: string): Promise<void>;
29
+ /**
30
+ * The person ends a live chat from their side ("Encerrar"), whoever took it.
31
+ * Optional: without it the chat leaves the queue when nobody took it
32
+ * (cancelRequest) and, past that, the team is told in the thread and closes it.
33
+ */
34
+ endChat?(requestId: string): Promise<void>;
23
35
  validateRequest(requestId: string, ok: boolean, reason?: string): Promise<void>;
24
36
  markNotificationsRead(requestId: string): Promise<void>;
25
37
  /** A link to show/download an attachment; null = none. */
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/data/provider.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,cAAc,EAAE,oBAAoB,EAAE,YAAY,EAAE,aAAa,EAAE,iBAAiB,EACpF,yBAAyB,EAAE,iBAAiB,EAC7C,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAIjF,6DAA6D;AAC7D,MAAM,WAAW,iBAAiB;IAAG,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAA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AAG,IAAI,CAAC,CAAA;IACpD,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;IACvH,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;IAChD,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAA;IAE3D;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qGAAqG;IACrG,MAAM,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC3D;AAED,0EAA0E;AAC1E,eAAO,MAAM,uBAAuB,EAAE,mBAmCrC,CAAA;AAID,iEAAiE;AACjE,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,IAAI,GAAG,IAAI,CAEjF;AAED,wBAAgB,WAAW,IAAI,mBAAmB,CAEjD;AAED,mFAAmF;AACnF,wBAAgB,eAAe,IAAI,OAAO,CAEzC"}
package/dist/host.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { type PluginAITool } from '@fayz-ai/core';
2
3
  import { type SupportDataProvider } from './data/provider';
3
4
  import { type SupportRequestsPanelProps } from './views/SupportRequestsPanel';
4
5
  import { type SupportRequestFormProps } from './views/SupportRequestForm';
@@ -11,6 +12,14 @@ export interface SupportHostOptions {
11
12
  dataProvider: SupportDataProvider;
12
13
  /** "Toda a empresa" — the host's own permission (the V1: support_tickets_license). Default false. */
13
14
  canSeeAll?: boolean;
15
+ /**
16
+ * Install the support INSIDE the assistant's conversation (default true): the
17
+ * support chips with their deterministic paths, the cards in the thread, the
18
+ * header's "Atendente" turning the same thread into the live chat, and the
19
+ * executors of `aiTools` (registerAIToolHandler). A host whose assistant is
20
+ * the SDK chat leaves it on; it is what makes the V1 and the V2 the same.
21
+ */
22
+ inChat?: boolean;
14
23
  }
15
24
  export interface SupportHost {
16
25
  provider: SupportDataProvider;
@@ -28,6 +37,15 @@ export interface SupportHost {
28
37
  useLiveChatDoor: (refreshKey?: unknown) => LiveChatDoor;
29
38
  /** Opens a request in the store (the detail surface reads it). */
30
39
  select: (id: string | null) => Promise<void>;
40
+ /**
41
+ * The support tools for the assistant's catalog (reportIssue,
42
+ * findSupportRequests, startLiveChat, openSupportRequest) — the V1 declares
43
+ * them with `registerModuleAITools` so its brain can call them; the executors
44
+ * are already registered (inChat).
45
+ */
46
+ aiTools: PluginAITool[];
47
+ /** Re-checks whether this account has a live chat and (un)registers the header's "Atendente". */
48
+ refreshSupportHandler: () => Promise<boolean>;
31
49
  /** Restores the platform provider and empties the store. */
32
50
  dispose: () => void;
33
51
  }
@@ -38,6 +56,9 @@ export type { SupportDataProvider, ChatThreadMessage } from './data/provider';
38
56
  export { useSupportStore } from './store';
39
57
  export { requestLiveChat, useLiveChatDoor, liveChatHint, type LiveChatHandoff, type LiveChatDoor } from './livechat/door';
40
58
  export { buildTranscript, chatSubject, type TranscriptMessage } from './livechat/rules';
59
+ export { supportAITools, supportToolHandlers, SUPPORT_DOOR_SUGGESTIONS } from './lib/report-tool';
60
+ export { installSupportInChat, refreshSupportHandler, getInChatController } from './livechat/in-chat-install';
61
+ export { stepInChat, statusLine, INITIAL_IN_CHAT, type InChatState, type InChatPhase, type InChatEvent } from './livechat/in-chat-machine';
41
62
  export type { SupportRequestsPanelProps } from './views/SupportRequestsPanel';
42
63
  export type { SupportRailChrome } from './lib/rail-chrome';
43
64
  export type { SupportRequestFormProps } from './views/SupportRequestForm';
@@ -1 +1 @@
1
- {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/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8B,CAAA;AAC7E,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,YAAY,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAClE,YAAY,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AACjE,cAAc,SAAS,CAAA"}
package/dist/host.js CHANGED
@@ -1,15 +1,22 @@
1
+ import { useLiveChatDoor, SupportRequestDetail, SupportRequestForm, SupportMenu, SupportRequestsPanel } from './chunk-P4VNMWIT.js';
2
+ export { liveChatHint, requestLiveChat, useLiveChatDoor } from './chunk-P4VNMWIT.js';
1
3
  import { supportLocales } from './chunk-7RHEXUVI.js';
2
- import { SupportRequestDetail, SupportRequestForm, SupportMenu, SupportRequestsPanel } from './chunk-37ZZRVI7.js';
3
- import { useLiveChatDoor } from './chunk-JT4ZPWH7.js';
4
- export { liveChatHint, requestLiveChat, useLiveChatDoor } from './chunk-JT4ZPWH7.js';
5
- import { useSupportStore, LiveChatPanel } from './chunk-PIMV3VRT.js';
6
- export { useSupportStore } from './chunk-PIMV3VRT.js';
7
- import { setSupportDataProvider } from './chunk-STEDUFNR.js';
8
- import { MAX_ATTACHMENTS } from './chunk-MQXGB4IO.js';
9
- export { MAX_ATTACHMENTS, MAX_ATTACHMENT_BYTES, SUPPORT_BUCKET, buildTranscript, chatSubject } from './chunk-MQXGB4IO.js';
10
- import './chunk-CWCN5PDE.js';
4
+ import { LiveChatPanel } from './chunk-DTO5R6GN.js';
5
+ import './chunk-E5242OSS.js';
6
+ import './chunk-5MGCM5C4.js';
7
+ import { installSupportInChat, refreshSupportHandler } from './chunk-QBOQYER7.js';
8
+ export { INITIAL_IN_CHAT, getInChatController, installSupportInChat, refreshSupportHandler, statusLine, stepInChat } from './chunk-QBOQYER7.js';
9
+ import './chunk-JOS2QQML.js';
10
+ import { supportAITools } from './chunk-Y673XGDK.js';
11
+ export { SUPPORT_DOOR_SUGGESTIONS, supportAITools, supportToolHandlers } from './chunk-Y673XGDK.js';
12
+ import { setSupportDataProvider, useSupportStore } from './chunk-WHEJ63CM.js';
13
+ export { useSupportStore } from './chunk-WHEJ63CM.js';
14
+ import { MAX_ATTACHMENTS } from './chunk-S766CRAY.js';
15
+ export { MAX_ATTACHMENTS, MAX_ATTACHMENT_BYTES, SUPPORT_BUCKET, buildTranscript, chatSubject } from './chunk-S766CRAY.js';
11
16
  import './chunk-ZEHBREG5.js';
12
- import './chunk-WOZTA5LS.js';
17
+ import './chunk-3WPESEK2.js';
18
+ import './chunk-PHIPTZSD.js';
19
+ import './chunk-L2HGTGW4.js';
13
20
  import { registerTranslations } from '@fayz-ai/core';
14
21
  import { jsx } from 'react/jsx-runtime';
15
22
 
@@ -299,6 +306,8 @@ function createMockSupportHostTransport(seed = {}) {
299
306
  if (!["received", "triage", "waiting_you"].includes(t.status)) throw new MockError("Esta solicita\xE7\xE3o n\xE3o pode mais ser cancelada.");
300
307
  touch(t, "cancelled");
301
308
  event(t.id, "cancelled");
309
+ } else if (t.status !== "resolved_check") {
310
+ throw new MockError("Esta solicita\xE7\xE3o n\xE3o est\xE1 esperando a sua confirma\xE7\xE3o.");
302
311
  } else if (args.action === "accept") {
303
312
  touch(t, "closed");
304
313
  event(t.id, "validated_ok");
@@ -357,6 +366,8 @@ function createSupportHost(options) {
357
366
  setSupportDataProvider(options.dataProvider);
358
367
  useSupportStore.getState().reset();
359
368
  const canSeeAll = options.canSeeAll ?? false;
369
+ const uninstall = options.inChat === false ? null : installSupportInChat();
370
+ if (uninstall) void refreshSupportHandler();
360
371
  function RequestsPanel(props) {
361
372
  return /* @__PURE__ */ jsx(SupportRequestsPanel, { canSeeAll, ...props });
362
373
  }
@@ -370,7 +381,10 @@ function createSupportHost(options) {
370
381
  LiveChatPanel,
371
382
  useLiveChatDoor,
372
383
  select: (id) => useSupportStore.getState().select(id),
384
+ aiTools: supportAITools,
385
+ refreshSupportHandler,
373
386
  dispose: () => {
387
+ uninstall?.();
374
388
  setSupportDataProvider(null);
375
389
  useSupportStore.getState().reset();
376
390
  }