@fayz-ai/plugin-support 0.3.0-canary.20261028153856 → 0.3.1
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.
- package/dist/{HelpdeskConsole-YCFXPFIX.js → HelpdeskConsole-EATEBVLN.js} +9 -8
- package/dist/HelpdeskConsole-EATEBVLN.js.map +1 -0
- package/dist/{LiveChatAgentWatcher-EGPPEZ4L.js → LiveChatAgentWatcher-WEUHRRLC.js} +9 -9
- package/dist/{LiveChatAgentWatcher-EGPPEZ4L.js.map → LiveChatAgentWatcher-WEUHRRLC.js.map} +1 -1
- package/dist/{OpenTicketFromConversation-KDXK7A6L.js → OpenTicketFromConversation-RC26KHN3.js} +4 -4
- package/dist/{OpenTicketFromConversation-KDXK7A6L.js.map → OpenTicketFromConversation-RC26KHN3.js.map} +1 -1
- package/dist/{SupportCenter-7UQGJGOV.js → SupportCenter-HGQL4PBX.js} +10 -9
- package/dist/SupportCenter-HGQL4PBX.js.map +1 -0
- package/dist/{SupportSettingsPage-PB6A3VCI.js → SupportSettingsPage-LIVZY2XQ.js} +3 -3
- package/dist/{SupportSettingsPage-PB6A3VCI.js.map → SupportSettingsPage-LIVZY2XQ.js.map} +1 -1
- package/dist/chunk-5MGCM5C4.js +181 -0
- package/dist/chunk-5MGCM5C4.js.map +1 -0
- package/dist/{chunk-2MHNBXOX.js → chunk-DTO5R6GN.js} +5 -5
- package/dist/{chunk-2MHNBXOX.js.map → chunk-DTO5R6GN.js.map} +1 -1
- package/dist/{chunk-UM4GEZWF.js → chunk-E5242OSS.js} +3 -3
- package/dist/{chunk-UM4GEZWF.js.map → chunk-E5242OSS.js.map} +1 -1
- package/dist/{chunk-5JJEN6KO.js → chunk-E5EXC7QW.js} +56 -17
- package/dist/chunk-E5EXC7QW.js.map +1 -0
- package/dist/{chunk-WOZTA5LS.js → chunk-L2HGTGW4.js} +6 -4
- package/dist/chunk-L2HGTGW4.js.map +1 -0
- package/dist/{chunk-BZBC2OYM.js → chunk-P4VNMWIT.js} +9 -180
- package/dist/chunk-P4VNMWIT.js.map +1 -0
- package/dist/{chunk-CWCN5PDE.js → chunk-PHIPTZSD.js} +48 -5
- package/dist/chunk-PHIPTZSD.js.map +1 -0
- package/dist/chunk-QBOQYER7.js +1603 -0
- package/dist/chunk-QBOQYER7.js.map +1 -0
- package/dist/{chunk-77VZVUK3.js → chunk-S766CRAY.js} +18 -5
- package/dist/chunk-S766CRAY.js.map +1 -0
- package/dist/{chunk-MGBQNKCH.js → chunk-WHEJ63CM.js} +4 -3
- package/dist/chunk-WHEJ63CM.js.map +1 -0
- package/dist/{chunk-5NDPMWHS.js → chunk-Y673XGDK.js} +36 -25
- package/dist/chunk-Y673XGDK.js.map +1 -0
- package/dist/data/api.d.ts +5 -0
- package/dist/data/api.d.ts.map +1 -1
- package/dist/data/console.d.ts +6 -0
- package/dist/data/console.d.ts.map +1 -1
- package/dist/data/mock-host.d.ts.map +1 -1
- package/dist/data/provider.d.ts +6 -0
- package/dist/data/provider.d.ts.map +1 -1
- package/dist/host.js +17 -14
- package/dist/host.js.map +1 -1
- package/dist/in-chat-install-2BTKBF2Z.js +11 -0
- package/dist/{in-chat-install-633DIRHJ.js.map → in-chat-install-2BTKBF2Z.js.map} +1 -1
- package/dist/index.js +16 -16
- package/dist/lib/imported.d.ts +27 -0
- package/dist/lib/imported.d.ts.map +1 -0
- package/dist/lib/report-tool.d.ts +13 -0
- package/dist/lib/report-tool.d.ts.map +1 -1
- package/dist/lib/vocabulary.d.ts.map +1 -1
- package/dist/livechat/in-chat-install.d.ts +2 -0
- package/dist/livechat/in-chat-install.d.ts.map +1 -1
- package/dist/livechat/in-chat-machine.d.ts +17 -3
- package/dist/livechat/in-chat-machine.d.ts.map +1 -1
- package/dist/livechat/in-chat-request-machine.d.ts +147 -0
- package/dist/livechat/in-chat-request-machine.d.ts.map +1 -0
- package/dist/livechat/in-chat-request.d.ts +94 -0
- package/dist/livechat/in-chat-request.d.ts.map +1 -0
- package/dist/livechat/in-chat-widgets.d.ts +13 -1
- package/dist/livechat/in-chat-widgets.d.ts.map +1 -1
- package/dist/livechat/in-chat.d.ts +20 -10
- package/dist/livechat/in-chat.d.ts.map +1 -1
- package/dist/livechat/report-intake.d.ts +45 -0
- package/dist/livechat/report-intake.d.ts.map +1 -0
- package/dist/livechat/screen-capture.d.ts +7 -0
- package/dist/livechat/screen-capture.d.ts.map +1 -0
- package/dist/migrations/index.d.ts +2 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/main.browser.js +3 -1
- package/dist/migrations/main.browser.js.map +1 -1
- package/dist/migrations/main.js +1181 -2
- package/dist/migrations/main.js.map +1 -1
- package/dist/screen-capture-FRMTTRUY.js +77 -0
- package/dist/screen-capture-FRMTTRUY.js.map +1 -0
- package/dist/types.d.ts +5 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/views/TicketSheet.d.ts +11 -1
- package/dist/views/TicketSheet.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/HelpdeskConsole-YCFXPFIX.js.map +0 -1
- package/dist/SupportCenter-7UQGJGOV.js.map +0 -1
- package/dist/chunk-5JJEN6KO.js.map +0 -1
- package/dist/chunk-5NDPMWHS.js.map +0 -1
- package/dist/chunk-77VZVUK3.js.map +0 -1
- package/dist/chunk-BZBC2OYM.js.map +0 -1
- package/dist/chunk-CB3B4FFU.js +0 -1002
- package/dist/chunk-CB3B4FFU.js.map +0 -1
- package/dist/chunk-CWCN5PDE.js.map +0 -1
- package/dist/chunk-MGBQNKCH.js.map +0 -1
- package/dist/chunk-WOZTA5LS.js.map +0 -1
- package/dist/in-chat-install-633DIRHJ.js +0 -11
package/dist/host.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/data/host-provider.ts","../src/data/mock-host.ts","../src/host.tsx"],"names":["row","t"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAM,GAAA,GAAM,CAAC,CAAA,KAA+B,OAAO,MA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;AAAA,IACnC;AAAA,GACF;AACF","file":"host.js","sourcesContent":["// A SupportDataProvider for a HOST whose browser has no session in this pool\n// (the V1): every call is one operation of the `support.host` request\n// (@fayz-ai/contracts/v1-bridge) handed to the host's transport — in the V1, its\n// edge `support-v2`, which proves the V1 session, signs and forwards to the\n// V2 bridge. The answers are support_host_call rows (support 030), mapped here\n// to the same domain types the platform screens use.\n//\n// Files go straight to this pool's storage: `open` answers one signed upload\n// link per attachment and the browser PUTs the file there (no key crosses).\nimport type {\n SupportRequest, SupportRequestDetail, SupportMessage, SupportEvent, SupportAttachment,\n CreateSupportRequestInput, PendingAttachment, SupportScope, SupportFilter,\n} from '../types'\nimport { MAX_ATTACHMENTS } from '../types'\nimport type { ChatAvailability, ChatState } from '../livechat/api'\nimport type { SupportBusinessHours } from '../lib/support-settings'\nimport type { ChatThreadMessage, SupportDataProvider } from './provider'\n\n/** One `support.host` operation: resolves with `result`, rejects with an Error whose message the screen shows. */\nexport type SupportHostTransport = (op: string, args: Record<string, unknown>) => Promise<Record<string, unknown>>\n\nexport interface SupportHostProviderOptions {\n call: SupportHostTransport\n /** The house as the host knows it (shown on the team's card). */\n house?: () => { houseName?: string | null; unitName?: string | null }\n /** PUT one file to a signed upload link. Default: fetch PUT with the file as the body. */\n upload?: (url: string, file: Blob, contentType: string) => Promise<void>\n /** Re-read cadence without Realtime (ms). Default: detail 10 s, chat 4 s, door 30 s. */\n pollMs?: { detail?: number; chat?: number; door?: number }\n}\n\nconst str = (v: unknown): string | null => (typeof v === 'string' && v !== '' ? v : null)\n\nexport function toHostRequest(r: any): SupportRequest {\n return {\n id: r.id,\n tenantId: r.tenant_id,\n number: r.number,\n kind: r.kind,\n subject: r.subject ?? null,\n description: r.description ?? '',\n status: r.status,\n route: r.route ?? null,\n unitId: r.unit_id ?? null,\n screenSnapshot: r.screen_snapshot ?? {},\n originConversationId: r.origin_conversation_id ?? null,\n conversationId: r.conversation_id ?? null,\n area: r.area ?? null,\n createdBy: r.created_by ?? '',\n createdAt: r.created_at,\n updatedAt: r.updated_at ?? r.created_at,\n resolvedAt: r.resolved_at ?? null,\n metadata: r.metadata ?? {},\n }\n}\n\nconst toMessage = (requestId: string) => (m: any): SupportMessage => ({\n id: m.id, requestId, authorKind: m.author_kind === 'team' ? 'team' : 'user', authorId: null,\n body: m.body ?? '', createdAt: m.created_at, legacy: m.legacy === true,\n})\nconst toEvent = (e: any): SupportEvent => ({ id: e.id, requestId: e.request_id, type: e.type, note: e.note ?? null, createdAt: e.created_at })\nconst toAttachment = (a: any): SupportAttachment => ({\n id: a.id, requestId: a.request_id, storagePath: a.storage_path, name: a.name, sizeBytes: a.size_bytes ?? null,\n contentType: a.content_type ?? null, createdAt: a.created_at, url: a.url ?? null,\n})\n\nasync function defaultUpload(url: string, file: Blob, contentType: string): Promise<void> {\n const res = await fetch(url, { method: 'PUT', body: file, headers: { 'content-type': contentType, 'x-upsert': 'false' } })\n if (!res.ok) throw new Error(`upload ${res.status}`)\n}\n\nexport function createSupportHostProvider(options: SupportHostProviderOptions): SupportDataProvider {\n const { call } = options\n const upload = options.upload ?? defaultUpload\n const house = () => {\n const h = options.house?.() ?? {}\n return { house_name: h.houseName ?? null, unit_name: h.unitName ?? null }\n }\n\n // ChatView reads the state and the messages together: one 'chat' round trip serves both.\n let inflight: { id: string; at: number; p: Promise<Record<string, unknown>> } | null = null\n const chatOf = (id: string) => {\n if (inflight && inflight.id === id && Date.now() - inflight.at < 1_000) return inflight.p\n const p = call('chat', { request_id: id })\n inflight = { id, at: Date.now(), p }\n p.catch(() => { if (inflight?.p === p) inflight = null })\n return p\n }\n\n return {\n realtime: false,\n pollMs: { detail: 10_000, chat: 4_000, door: 30_000, ...options.pollMs },\n\n async listRequests(scope: SupportScope, filter: SupportFilter) {\n const r = await call('list', { scope, filter })\n return ((r.requests as unknown[]) ?? []).map(toHostRequest)\n },\n\n async getRequestDetail(id) {\n const r: any = await call('detail', { request_id: id })\n if (!r?.id) return null\n const detail: SupportRequestDetail = {\n ...toHostRequest(r),\n messages: ((r.messages as unknown[]) ?? []).map(toMessage(id)),\n events: ((r.events as unknown[]) ?? []).map(toEvent),\n attachments: ((r.attachments as unknown[]) ?? []).map(toAttachment),\n }\n return detail\n },\n\n async unreadCount() {\n const r = await call('list', { scope: 'mine', filter: 'waiting' })\n return typeof r.attention === 'number' ? r.attention : ((r.requests as unknown[]) ?? []).length\n },\n\n async createRequest(input: CreateSupportRequestInput, attachments: PendingAttachment[]) {\n const files = attachments.slice(0, MAX_ATTACHMENTS)\n const r: any = await call('open', {\n kind: input.kind,\n description: input.description.trim(),\n subject: input.subject?.trim() || null,\n route: input.route ?? null,\n screen_snapshot: input.screenSnapshot ?? {},\n origin_conversation_id: input.originConversationId ?? null,\n attachments: files.map((f) => ({ name: f.name, content_type: f.contentType || 'application/octet-stream', size_bytes: Math.max(1, f.sizeBytes) })),\n ...house(),\n })\n const uploads: any[] = Array.isArray(r.uploads) ? r.uploads : []\n await Promise.all(files.map(async (f, i) => {\n const target = uploads[i]\n if (!target?.upload_url) return\n // One failed upload does not fail the request (the platform's rule too).\n try { await upload(target.upload_url, f.file, f.contentType || 'application/octet-stream') } catch { /* the card shows it without a link */ }\n }))\n return { id: r.id, number: r.number }\n },\n\n async addMessage(requestId, body) { await call('reply', { request_id: requestId, body: body.trim() }) },\n async cancelRequest(requestId) { await call('status', { request_id: requestId, action: 'cancel' }) },\n async validateRequest(requestId, ok, reason) {\n await call('status', { request_id: requestId, action: ok ? 'accept' : 'reopen', reason: reason ?? null })\n },\n // The host's notices are its own; nothing to mark in this pool.\n async markNotificationsRead() {},\n async attachmentUrl(att) { return att.url ?? null },\n\n async chatAvailability(): Promise<ChatAvailability | null> {\n const d: any = await call('chat_availability', {})\n return {\n homeId: str(d.home_id),\n enabled: d.enabled === true,\n offlineMessage: str(d.offline_message),\n businessHours: (d.business_hours ?? {}) as SupportBusinessHours,\n timezone: str(d.timezone) ?? 'America/Sao_Paulo',\n activeChat: d.active_chat ? { id: d.active_chat.id, number: d.active_chat.number } : null,\n online: Math.max(0, Number(d.online) || 0),\n }\n },\n\n async openChat(input) {\n const d: any = await call('chat_open', {\n subject: input.subject ?? null,\n description: input.description ?? null,\n route: input.route ?? null,\n origin_conversation_id: input.originConversationId ?? null,\n screen_snapshot: input.screenSnapshot ?? {},\n ...house(),\n })\n return { id: d.id, number: d.number, conversationId: d.conversation_id ?? null, reused: d.reused === true }\n },\n\n async chatState(requestId): Promise<ChatState> {\n const d: any = ((await chatOf(requestId)) as any).state ?? {}\n return {\n id: d.id, number: d.number, status: d.status, waiting: d.waiting === true,\n position: typeof d.position === 'number' ? d.position : null,\n teamReplied: d.team_replied === true, agentName: d.agent_name ?? null,\n conversationId: d.conversation_id ?? null, homeId: d.home_id ?? null,\n }\n },\n\n async chatThread(requestId): Promise<ChatThreadMessage[]> {\n const d: any = await chatOf(requestId)\n return ((d.messages as any[]) ?? []).map((m) => ({\n id: m.id, mine: m.author_kind !== 'team', author: m.author ?? null, body: m.body ?? '', at: m.created_at,\n }))\n },\n }\n}\n","// An in-memory `support.host` transport: the same rows support_host_call\n// (support 030) answers, kept in the page. For a host to draw the screens before\n// its edge or the V2 are deployed (dev, QA without writes, tests) — never real data.\nimport type { SupportHostTransport } from './host-provider'\n\nexport interface MockSupportHostSeed {\n /** Who is asking (the V1 user). */\n me?: { id: string; name: string }\n /** Agents online at the central (the live-chat door). Default 1. */\n online?: number\n /** The live chat is taken by \"Ana Souza (Suporte)\" after this many ms. Default 6000; null = never. */\n acceptAfterMs?: number | null\n /** Start with the sample tickets (default true). */\n samples?: boolean\n}\n\ntype Row = Record<string, any>\n\nconst iso = (msAgo = 0) => new Date(Date.now() - msAgo).toISOString()\nconst uuid = () => (globalThis.crypto?.randomUUID?.() ?? `${Date.now().toString(16)}-0000-4000-8000-${Math.random().toString(16).slice(2, 14).padEnd(12, '0')}`)\n\nclass MockError extends Error {}\n\nexport function createMockSupportHostTransport(seed: MockSupportHostSeed = {}): SupportHostTransport {\n const me = seed.me ?? { id: '7a1b2c3d-0000-4000-8000-00000000a0a0', name: 'Ana (demonstração)' }\n const tenant = 'mock-platform'\n let number = 40\n const tickets: Row[] = []\n const messages = new Map<string, Row[]>()\n const events = new Map<string, Row[]>()\n const files = new Map<string, Row[]>()\n const chatOpenedAt = new Map<string, number>()\n\n function add(kind: string, subject: string, description: string, status: string, msAgo: number): Row {\n const id = uuid()\n const row: Row = {\n id, tenant_id: tenant, number: ++number, kind, subject, description, status, route: null, unit_id: null,\n screen_snapshot: {}, origin_conversation_id: null, conversation_id: uuid(), area: null, created_by: me.id,\n created_at: iso(msAgo), updated_at: iso(msAgo), resolved_at: null, metadata: { opened_by_name: me.name }, assignee: null,\n }\n tickets.unshift(row)\n messages.set(id, [])\n events.set(id, [{ id: uuid(), request_id: id, type: 'opened', note: null, created_at: row.created_at }])\n files.set(id, [])\n return row\n }\n const say = (id: string, team: boolean, body: string, msAgo = 0, author: string | null = null) =>\n messages.get(id)!.push({ id: uuid(), author_kind: team ? 'team' : 'user', author: team ? (author ?? 'Suporte') : null, body, created_at: iso(msAgo), legacy: false })\n const event = (id: string, type: string, note: string | null = null) =>\n events.get(id)!.push({ id: uuid(), request_id: id, type, note, created_at: iso() })\n\n if (seed.samples !== false) {\n const a = add('problem', 'A impressora da cozinha não imprime a comanda', 'Desde ontem à noite a comanda não sai na impressora da cozinha.', 'waiting_you', 26 * 3600_000)\n say(a.id, false, 'Já reiniciei a impressora e nada.', 25 * 3600_000)\n say(a.id, true, 'Oi! Pode mandar um print da tela de impressoras em Configurações?', 3 * 3600_000, 'Bia Atendente')\n event(a.id, 'status_changed', 'waiting_you')\n const b = add('improvement', 'Atalho para dividir a conta no PDV', 'Seria ótimo ter um botão direto para dividir a conta por pessoa.', 'in_service', 3 * 86400_000)\n say(b.id, true, 'Boa ideia! Levamos para o time de produto.', 2 * 86400_000, 'Bia Atendente')\n add('other', 'Treinamento para a equipe nova', 'Gostaria de agendar um treinamento para três pessoas.', 'closed', 9 * 86400_000)\n }\n\n const find = (id: unknown) => {\n const t = tickets.find((x) => x.id === id)\n if (!t) throw new MockError('Solicitação não encontrada.')\n return t\n }\n const row = (t: Row) => { const { assignee: _a, ...r } = t; return { ...r } }\n const attention = () => tickets.filter((t) => ['waiting_you', 'resolved_check'].includes(t.status)).length\n const touch = (t: Row, status?: string) => { if (status) t.status = status; t.updated_at = iso() }\n\n /** The mock \"agent\": takes the chat a few seconds after it opened, and greets. */\n function tick(t: Row) {\n if (t.kind !== 'chat' || t.assignee || seed.acceptAfterMs === null) return\n const opened = chatOpenedAt.get(t.id) ?? 0\n if (Date.now() - opened < (seed.acceptAfterMs ?? 6_000)) return\n t.assignee = 'Ana Souza (Suporte)'\n touch(t, 'in_service')\n say(t.id, true, 'Olá! Aqui é Ana, do suporte. Já li a sua conversa com o atendimento automático. Como posso ajudar?', 0, 'Ana Souza (Suporte)')\n }\n\n return async (op, args) => {\n await new Promise((r) => setTimeout(r, 150))\n switch (op) {\n case 'list': {\n const want = args.filter === 'waiting' ? ['waiting_you', 'resolved_check']\n : args.filter === 'in_progress' ? ['received', 'triage', 'in_service', 'in_development']\n : args.filter === 'closed' ? ['closed', 'cancelled'] : null\n return { requests: tickets.filter((t) => !want || want.includes(t.status)).map(row), attention: attention() }\n }\n case 'detail': {\n const t = find(args.request_id)\n return { ...row(t), messages: messages.get(t.id), events: events.get(t.id), attachments: files.get(t.id) }\n }\n case 'open': {\n const desc = String(args.description ?? '').trim()\n if (desc.length < 5) throw new MockError('Descreva com pelo menos 5 caracteres.')\n const t = add(String(args.kind), String(args.subject ?? '').trim() || desc.split('\\n')[0]!.slice(0, 80), desc, 'received', 0)\n const uploads = ((args.attachments as Row[]) ?? []).map((f) => {\n const aid = uuid()\n files.get(t.id)!.push({ id: aid, request_id: t.id, storage_path: `${tenant}/${t.id}/${aid}/${f.name}`, name: f.name, size_bytes: f.size_bytes, content_type: f.content_type, created_at: iso(), url: null })\n return { attachment_id: aid, name: f.name, storage_path: `${tenant}/${t.id}/${aid}/${f.name}`, upload_url: null }\n })\n return { id: t.id, number: t.number, conversation_id: t.conversation_id, uploads }\n }\n case 'reply': {\n const t = find(args.request_id)\n if (['closed', 'cancelled'].includes(t.status)) throw new MockError('Esta solicitação está encerrada.')\n say(t.id, false, String(args.body ?? ''))\n if (t.status === 'waiting_you') touch(t, 'in_service')\n return { conversation_id: t.conversation_id, messages: messages.get(t.id) }\n }\n case 'status': {\n const t = find(args.request_id)\n if (args.action === 'cancel') {\n if (!['received', 'triage', 'waiting_you'].includes(t.status)) throw new MockError('Esta solicitação não pode mais ser cancelada.')\n touch(t, 'cancelled'); event(t.id, 'cancelled')\n } else if (args.action === 'accept') {\n touch(t, 'closed'); event(t.id, 'validated_ok')\n } else {\n touch(t, 'received'); event(t.id, 'reopened', (args.reason as string) ?? null)\n }\n return row(t)\n }\n case 'chat_availability': {\n const active = tickets.find((t) => t.kind === 'chat' && !['resolved_check', 'closed', 'cancelled'].includes(t.status))\n return {\n home_id: 'mock-central', enabled: true, online: seed.online ?? 1,\n offline_message: 'Abra uma solicitação e respondemos por aqui e por e-mail.',\n business_hours: {}, timezone: 'America/Sao_Paulo',\n active_chat: active ? { id: active.id, number: active.number } : null,\n }\n }\n case 'chat_open': {\n const active = tickets.find((t) => t.kind === 'chat' && !['resolved_check', 'closed', 'cancelled'].includes(t.status))\n if (active) return { id: active.id, number: active.number, conversation_id: active.conversation_id, reused: true }\n const t = add('chat', String(args.subject ?? '') || 'Conversa com atendente', String(args.description ?? '') || 'A pessoa pediu para falar com um atendente.', 'received', 0)\n chatOpenedAt.set(t.id, Date.now())\n return { id: t.id, number: t.number, conversation_id: t.conversation_id, reused: false }\n }\n case 'chat': {\n const t = find(args.request_id)\n tick(t)\n const waiting = t.kind === 'chat' && !t.assignee && !['resolved_check', 'closed', 'cancelled'].includes(t.status)\n return {\n state: {\n id: t.id, number: t.number, kind: t.kind, status: t.status, waiting, position: waiting ? 1 : null,\n team_replied: (messages.get(t.id) ?? []).some((m) => m.author_kind === 'team'),\n agent_name: t.assignee ? String(t.assignee).split(' ')[0] : null, conversation_id: t.conversation_id, home_id: 'mock-central',\n },\n messages: messages.get(t.id),\n }\n }\n default:\n throw new MockError(`operação desconhecida: ${op}`)\n }\n }\n}\n","// `@fayz-ai/plugin-support/host` — the requester's support screens for a host\n// that does not run AdminShell nor the plugin runtime (the V1 drawing them slot\n// by slot), the way `@fayz-ai/plugin-getting-started/host` hosts the journey.\n//\n// The screens are the platform's own (SupportRequestsPanel, SupportMenu,\n// SupportRequestForm, SupportRequestDetail, LiveChatPanel); only the data port\n// changes: `dataProvider` is injected and nothing below touches this pool's\n// Supabase client. A host whose browser has no session here builds it with\n// `createSupportHostProvider({ call })` over its own transport — the V1 sends\n// each operation through its edge `support-v2`, signed to the V2 bridge\n// (`support.host`, @fayz-ai/contracts/v1-bridge) — and the ticket is born and\n// lives in the V2 (plugin-support 030).\nimport * as React from 'react'\nimport { registerTranslations, type PluginAITool } from '@fayz-ai/core'\nimport { supportLocales } from './locales'\nimport { useSupportStore } from './store'\nimport { setSupportDataProvider, type SupportDataProvider } from './data/provider'\nimport { SupportRequestsPanel, type SupportRequestsPanelProps } from './views/SupportRequestsPanel'\nimport { SupportRequestForm, type SupportRequestFormProps } from './views/SupportRequestForm'\nimport { SupportRequestDetail, type SupportRequestDetailProps } from './views/SupportRequestDetail'\nimport { SupportMenu, type SupportMenuProps } from './views/SupportMenu'\nimport { LiveChatPanel, type LiveChatPanelProps } from './livechat/LiveChatPanel'\nimport { useLiveChatDoor, type LiveChatDoor } from './livechat/door'\nimport { supportAITools } from './lib/report-tool'\nimport { installSupportInChat, refreshSupportHandler } from './livechat/in-chat-install'\n\nexport interface SupportHostOptions {\n /** Where every read and write goes. Required: there is no platform default in a host. */\n dataProvider: SupportDataProvider\n /** \"Toda a empresa\" — the host's own permission (the V1: support_tickets_license). Default false. */\n canSeeAll?: boolean\n /**\n * Install the support INSIDE the assistant's conversation (default true): the\n * support chips with their deterministic paths, the cards in the thread, the\n * header's \"Atendente\" turning the same thread into the live chat, and the\n * executors of `aiTools` (registerAIToolHandler). A host whose assistant is\n * the SDK chat leaves it on; it is what makes the V1 and the V2 the same.\n */\n inChat?: boolean\n}\n\nexport interface SupportHost {\n provider: SupportDataProvider\n /** \"Minhas solicitações\": list ↔ detail ↔ menu ↔ form ↔ live chat, in one column. */\n RequestsPanel: React.ComponentType<SupportRequestsPanelProps>\n /** The four doors (\"Em que podemos ajudar?\"). */\n Menu: React.ComponentType<SupportMenuProps>\n /** One door's form (description, subject, prints and files). */\n RequestForm: React.ComponentType<SupportRequestFormProps>\n /** The selected request (use the store's `select(id)` first, or the panel). */\n RequestDetail: React.ComponentType<SupportRequestDetailProps>\n /** \"Conversar com um atendente\": connecting, the absence screen, the chat. */\n LiveChatPanel: React.ComponentType<LiveChatPanelProps>\n /** The door's state (who is online, the open chat) for a host's own button. */\n useLiveChatDoor: (refreshKey?: unknown) => LiveChatDoor\n /** Opens a request in the store (the detail surface reads it). */\n select: (id: string | null) => Promise<void>\n /**\n * The support tools for the assistant's catalog (reportIssue,\n * findSupportRequests, startLiveChat, openSupportRequest) — the V1 declares\n * them with `registerModuleAITools` so its brain can call them; the executors\n * are already registered (inChat).\n */\n aiTools: PluginAITool[]\n /** Re-checks whether this account has a live chat and (un)registers the header's \"Atendente\". */\n refreshSupportHandler: () => Promise<boolean>\n /** Restores the platform provider and empties the store. */\n dispose: () => void\n}\n\nexport function createSupportHost(options: SupportHostOptions): SupportHost {\n registerTranslations(supportLocales)\n setSupportDataProvider(options.dataProvider)\n useSupportStore.getState().reset()\n\n const canSeeAll = options.canSeeAll ?? false\n const uninstall = options.inChat === false ? null : installSupportInChat()\n if (uninstall) void refreshSupportHandler()\n function RequestsPanel(props: SupportRequestsPanelProps) {\n return <SupportRequestsPanel canSeeAll={canSeeAll} {...props} />\n }\n RequestsPanel.displayName = 'SupportHost(RequestsPanel)'\n\n return {\n provider: options.dataProvider,\n RequestsPanel,\n Menu: SupportMenu,\n RequestForm: SupportRequestForm,\n RequestDetail: SupportRequestDetail,\n LiveChatPanel,\n useLiveChatDoor,\n select: (id) => useSupportStore.getState().select(id),\n aiTools: supportAITools,\n refreshSupportHandler,\n dispose: () => {\n uninstall?.()\n setSupportDataProvider(null)\n useSupportStore.getState().reset()\n },\n }\n}\n\nexport { createSupportHostProvider, toHostRequest, type SupportHostTransport, type SupportHostProviderOptions } from './data/host-provider'\nexport { createMockSupportHostTransport, type MockSupportHostSeed } from './data/mock-host'\nexport type { SupportDataProvider, ChatThreadMessage } from './data/provider'\nexport { useSupportStore } from './store'\nexport { requestLiveChat, useLiveChatDoor, liveChatHint, type LiveChatHandoff, type LiveChatDoor } from './livechat/door'\nexport { buildTranscript, chatSubject, type TranscriptMessage } from './livechat/rules'\nexport { supportAITools, supportToolHandlers, SUPPORT_DOOR_SUGGESTIONS } from './lib/report-tool'\nexport { installSupportInChat, refreshSupportHandler, getInChatController } from './livechat/in-chat-install'\nexport { stepInChat, statusLine, INITIAL_IN_CHAT, type InChatState, type InChatPhase, type InChatEvent } from './livechat/in-chat-machine'\nexport type { SupportRequestsPanelProps } from './views/SupportRequestsPanel'\nexport type { SupportRailChrome } from './lib/rail-chrome'\nexport type { SupportRequestFormProps } from './views/SupportRequestForm'\nexport type { SupportRequestDetailProps } from './views/SupportRequestDetail'\nexport type { SupportMenuProps } from './views/SupportMenu'\nexport type { LiveChatPanelProps } from './livechat/LiveChatPanel'\nexport type { ChatAvailability, ChatState } from './livechat/api'\nexport * from './types'\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/data/host-provider.ts","../src/data/mock-host.ts","../src/host.tsx"],"names":["row","t"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAM,GAAA,GAAM,CAAC,CAAA,KAA+B,OAAO,MAAM,QAAA,IAAY,CAAA,KAAM,KAAK,CAAA,GAAI,IAAA;AAE7E,SAAS,cAAc,CAAA,EAAwB;AACpD,EAAA,OAAO;AAAA,IACL,IAAI,CAAA,CAAE,EAAA;AAA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ACF","file":"host.js","sourcesContent":["// A SupportDataProvider for a HOST whose browser has no session in this pool\n// (the V1): every call is one operation of the `support.host` request\n// (@fayz-ai/contracts/v1-bridge) handed to the host's transport — in the V1, its\n// edge `support-v2`, which proves the V1 session, signs and forwards to the\n// V2 bridge. The answers are support_host_call rows (support 030), mapped here\n// to the same domain types the platform screens use.\n//\n// Files go straight to this pool's storage: `open` answers one signed upload\n// link per attachment and the browser PUTs the file there (no key crosses).\nimport type {\n SupportRequest, SupportRequestDetail, SupportMessage, SupportEvent, SupportAttachment,\n CreateSupportRequestInput, PendingAttachment, SupportScope, SupportFilter,\n} from '../types'\nimport { MAX_ATTACHMENTS } from '../types'\nimport type { ChatAvailability, ChatState } from '../livechat/api'\nimport type { SupportBusinessHours } from '../lib/support-settings'\nimport type { ChatThreadMessage, SupportDataProvider } from './provider'\n\n/** One `support.host` operation: resolves with `result`, rejects with an Error whose message the screen shows. */\nexport type SupportHostTransport = (op: string, args: Record<string, unknown>) => Promise<Record<string, unknown>>\n\nexport interface SupportHostProviderOptions {\n call: SupportHostTransport\n /** The house as the host knows it (shown on the team's card). */\n house?: () => { houseName?: string | null; unitName?: string | null }\n /** PUT one file to a signed upload link. Default: fetch PUT with the file as the body. */\n upload?: (url: string, file: Blob, contentType: string) => Promise<void>\n /** Re-read cadence without Realtime (ms). Default: detail 10 s, chat 4 s, door 30 s. */\n pollMs?: { detail?: number; chat?: number; door?: number }\n}\n\nconst str = (v: unknown): string | null => (typeof v === 'string' && v !== '' ? v : null)\n\nexport function toHostRequest(r: any): SupportRequest {\n return {\n id: r.id,\n tenantId: r.tenant_id,\n number: r.number,\n kind: r.kind,\n subject: r.subject ?? null,\n description: r.description ?? '',\n status: r.status,\n route: r.route ?? null,\n unitId: r.unit_id ?? null,\n screenSnapshot: r.screen_snapshot ?? {},\n originConversationId: r.origin_conversation_id ?? null,\n conversationId: r.conversation_id ?? null,\n area: r.area ?? null,\n createdBy: r.created_by ?? '',\n createdAt: r.created_at,\n updatedAt: r.updated_at ?? r.created_at,\n resolvedAt: r.resolved_at ?? null,\n metadata: r.metadata ?? {},\n }\n}\n\nconst toMessage = (requestId: string) => (m: any): SupportMessage => ({\n id: m.id, requestId, authorKind: m.author_kind === 'team' ? 'team' : 'user', authorId: null,\n body: m.body ?? '', createdAt: m.created_at, legacy: m.legacy === true,\n})\nconst toEvent = (e: any): SupportEvent => ({ id: e.id, requestId: e.request_id, type: e.type, note: e.note ?? null, createdAt: e.created_at })\nconst toAttachment = (a: any): SupportAttachment => ({\n id: a.id, requestId: a.request_id, storagePath: a.storage_path, name: a.name, sizeBytes: a.size_bytes ?? null,\n contentType: a.content_type ?? null, createdAt: a.created_at, url: a.url ?? null,\n})\n\nasync function defaultUpload(url: string, file: Blob, contentType: string): Promise<void> {\n const res = await fetch(url, { method: 'PUT', body: file, headers: { 'content-type': contentType, 'x-upsert': 'false' } })\n if (!res.ok) throw new Error(`upload ${res.status}`)\n}\n\nexport function createSupportHostProvider(options: SupportHostProviderOptions): SupportDataProvider {\n const { call } = options\n const upload = options.upload ?? defaultUpload\n const house = () => {\n const h = options.house?.() ?? {}\n return { house_name: h.houseName ?? null, unit_name: h.unitName ?? null }\n }\n\n // ChatView reads the state and the messages together: one 'chat' round trip serves both.\n let inflight: { id: string; at: number; p: Promise<Record<string, unknown>> } | null = null\n const chatOf = (id: string) => {\n if (inflight && inflight.id === id && Date.now() - inflight.at < 1_000) return inflight.p\n const p = call('chat', { request_id: id })\n inflight = { id, at: Date.now(), p }\n p.catch(() => { if (inflight?.p === p) inflight = null })\n return p\n }\n\n return {\n realtime: false,\n pollMs: { detail: 10_000, chat: 4_000, door: 30_000, ...options.pollMs },\n\n async listRequests(scope: SupportScope, filter: SupportFilter) {\n const r = await call('list', { scope, filter })\n return ((r.requests as unknown[]) ?? []).map(toHostRequest)\n },\n\n async getRequestDetail(id) {\n const r: any = await call('detail', { request_id: id })\n if (!r?.id) return null\n const detail: SupportRequestDetail = {\n ...toHostRequest(r),\n messages: ((r.messages as unknown[]) ?? []).map(toMessage(id)),\n events: ((r.events as unknown[]) ?? []).map(toEvent),\n attachments: ((r.attachments as unknown[]) ?? []).map(toAttachment),\n }\n return detail\n },\n\n async unreadCount() {\n const r = await call('list', { scope: 'mine', filter: 'waiting' })\n return typeof r.attention === 'number' ? r.attention : ((r.requests as unknown[]) ?? []).length\n },\n\n async createRequest(input: CreateSupportRequestInput, attachments: PendingAttachment[]) {\n const files = attachments.slice(0, MAX_ATTACHMENTS)\n const r: any = await call('open', {\n kind: input.kind,\n description: input.description.trim(),\n subject: input.subject?.trim() || null,\n route: input.route ?? null,\n screen_snapshot: input.screenSnapshot ?? {},\n origin_conversation_id: input.originConversationId ?? null,\n attachments: files.map((f) => ({ name: f.name, content_type: f.contentType || 'application/octet-stream', size_bytes: Math.max(1, f.sizeBytes) })),\n ...house(),\n })\n const uploads: any[] = Array.isArray(r.uploads) ? r.uploads : []\n await Promise.all(files.map(async (f, i) => {\n const target = uploads[i]\n if (!target?.upload_url) return\n // One failed upload does not fail the request (the platform's rule too).\n try { await upload(target.upload_url, f.file, f.contentType || 'application/octet-stream') } catch { /* the card shows it without a link */ }\n }))\n return { id: r.id, number: r.number }\n },\n\n async addMessage(requestId, body) { await call('reply', { request_id: requestId, body: body.trim() }) },\n async cancelRequest(requestId) { await call('status', { request_id: requestId, action: 'cancel' }) },\n async validateRequest(requestId, ok, reason) {\n await call('status', { request_id: requestId, action: ok ? 'accept' : 'reopen', reason: reason ?? null })\n },\n // The host's notices are its own; nothing to mark in this pool.\n async markNotificationsRead() {},\n async attachmentUrl(att) { return att.url ?? null },\n\n async chatAvailability(): Promise<ChatAvailability | null> {\n const d: any = await call('chat_availability', {})\n return {\n homeId: str(d.home_id),\n enabled: d.enabled === true,\n offlineMessage: str(d.offline_message),\n businessHours: (d.business_hours ?? {}) as SupportBusinessHours,\n timezone: str(d.timezone) ?? 'America/Sao_Paulo',\n activeChat: d.active_chat ? { id: d.active_chat.id, number: d.active_chat.number } : null,\n online: Math.max(0, Number(d.online) || 0),\n }\n },\n\n async openChat(input) {\n const d: any = await call('chat_open', {\n subject: input.subject ?? null,\n description: input.description ?? null,\n route: input.route ?? null,\n origin_conversation_id: input.originConversationId ?? null,\n screen_snapshot: input.screenSnapshot ?? {},\n ...house(),\n })\n return { id: d.id, number: d.number, conversationId: d.conversation_id ?? null, reused: d.reused === true }\n },\n\n async chatState(requestId): Promise<ChatState> {\n const d: any = ((await chatOf(requestId)) as any).state ?? {}\n return {\n id: d.id, number: d.number, status: d.status, waiting: d.waiting === true,\n position: typeof d.position === 'number' ? d.position : null,\n teamReplied: d.team_replied === true, agentName: d.agent_name ?? null,\n conversationId: d.conversation_id ?? null, homeId: d.home_id ?? null,\n }\n },\n\n async chatThread(requestId): Promise<ChatThreadMessage[]> {\n const d: any = await chatOf(requestId)\n return ((d.messages as any[]) ?? []).map((m) => ({\n id: m.id, mine: m.author_kind !== 'team', author: m.author ?? null, body: m.body ?? '', at: m.created_at,\n }))\n },\n }\n}\n","// An in-memory `support.host` transport: the same rows support_host_call\n// (support 030) answers, kept in the page. For a host to draw the screens before\n// its edge or the V2 are deployed (dev, QA without writes, tests) — never real data.\nimport type { SupportHostTransport } from './host-provider'\n\nexport interface MockSupportHostSeed {\n /** Who is asking (the V1 user). */\n me?: { id: string; name: string }\n /** Agents online at the central (the live-chat door). Default 1. */\n online?: number\n /** The live chat is taken by \"Ana Souza (Suporte)\" after this many ms. Default 6000; null = never. */\n acceptAfterMs?: number | null\n /** Start with the sample tickets (default true). */\n samples?: boolean\n}\n\ntype Row = Record<string, any>\n\nconst iso = (msAgo = 0) => new Date(Date.now() - msAgo).toISOString()\nconst uuid = () => (globalThis.crypto?.randomUUID?.() ?? `${Date.now().toString(16)}-0000-4000-8000-${Math.random().toString(16).slice(2, 14).padEnd(12, '0')}`)\n\nclass MockError extends Error {}\n\nexport function createMockSupportHostTransport(seed: MockSupportHostSeed = {}): SupportHostTransport {\n const me = seed.me ?? { id: '7a1b2c3d-0000-4000-8000-00000000a0a0', name: 'Ana (demonstração)' }\n const tenant = 'mock-platform'\n let number = 40\n const tickets: Row[] = []\n const messages = new Map<string, Row[]>()\n const events = new Map<string, Row[]>()\n const files = new Map<string, Row[]>()\n const chatOpenedAt = new Map<string, number>()\n\n function add(kind: string, subject: string, description: string, status: string, msAgo: number): Row {\n const id = uuid()\n const row: Row = {\n id, tenant_id: tenant, number: ++number, kind, subject, description, status, route: null, unit_id: null,\n screen_snapshot: {}, origin_conversation_id: null, conversation_id: uuid(), area: null, created_by: me.id,\n created_at: iso(msAgo), updated_at: iso(msAgo), resolved_at: null, metadata: { opened_by_name: me.name }, assignee: null,\n }\n tickets.unshift(row)\n messages.set(id, [])\n events.set(id, [{ id: uuid(), request_id: id, type: 'opened', note: null, created_at: row.created_at }])\n files.set(id, [])\n return row\n }\n const say = (id: string, team: boolean, body: string, msAgo = 0, author: string | null = null) =>\n messages.get(id)!.push({ id: uuid(), author_kind: team ? 'team' : 'user', author: team ? (author ?? 'Suporte') : null, body, created_at: iso(msAgo), legacy: false })\n const event = (id: string, type: string, note: string | null = null) =>\n events.get(id)!.push({ id: uuid(), request_id: id, type, note, created_at: iso() })\n\n if (seed.samples !== false) {\n const a = add('problem', 'A impressora da cozinha não imprime a comanda', 'Desde ontem à noite a comanda não sai na impressora da cozinha.', 'waiting_you', 26 * 3600_000)\n say(a.id, false, 'Já reiniciei a impressora e nada.', 25 * 3600_000)\n say(a.id, true, 'Oi! Pode mandar um print da tela de impressoras em Configurações?', 3 * 3600_000, 'Bia Atendente')\n event(a.id, 'status_changed', 'waiting_you')\n const b = add('improvement', 'Atalho para dividir a conta no PDV', 'Seria ótimo ter um botão direto para dividir a conta por pessoa.', 'in_service', 3 * 86400_000)\n say(b.id, true, 'Boa ideia! Levamos para o time de produto.', 2 * 86400_000, 'Bia Atendente')\n add('other', 'Treinamento para a equipe nova', 'Gostaria de agendar um treinamento para três pessoas.', 'closed', 9 * 86400_000)\n }\n\n const find = (id: unknown) => {\n const t = tickets.find((x) => x.id === id)\n if (!t) throw new MockError('Solicitação não encontrada.')\n return t\n }\n const row = (t: Row) => { const { assignee: _a, ...r } = t; return { ...r } }\n const attention = () => tickets.filter((t) => ['waiting_you', 'resolved_check'].includes(t.status)).length\n const touch = (t: Row, status?: string) => { if (status) t.status = status; t.updated_at = iso() }\n\n /** The mock \"agent\": takes the chat a few seconds after it opened, and greets. */\n function tick(t: Row) {\n if (t.kind !== 'chat' || t.assignee || seed.acceptAfterMs === null) return\n const opened = chatOpenedAt.get(t.id) ?? 0\n if (Date.now() - opened < (seed.acceptAfterMs ?? 6_000)) return\n t.assignee = 'Ana Souza (Suporte)'\n touch(t, 'in_service')\n say(t.id, true, 'Olá! Aqui é Ana, do suporte. Já li a sua conversa com o atendimento automático. Como posso ajudar?', 0, 'Ana Souza (Suporte)')\n }\n\n return async (op, args) => {\n await new Promise((r) => setTimeout(r, 150))\n switch (op) {\n case 'list': {\n const want = args.filter === 'waiting' ? ['waiting_you', 'resolved_check']\n : args.filter === 'in_progress' ? ['received', 'triage', 'in_service', 'in_development']\n : args.filter === 'closed' ? ['closed', 'cancelled'] : null\n return { requests: tickets.filter((t) => !want || want.includes(t.status)).map(row), attention: attention() }\n }\n case 'detail': {\n const t = find(args.request_id)\n return { ...row(t), messages: messages.get(t.id), events: events.get(t.id), attachments: files.get(t.id) }\n }\n case 'open': {\n const desc = String(args.description ?? '').trim()\n if (desc.length < 5) throw new MockError('Descreva com pelo menos 5 caracteres.')\n const t = add(String(args.kind), String(args.subject ?? '').trim() || desc.split('\\n')[0]!.slice(0, 80), desc, 'received', 0)\n const uploads = ((args.attachments as Row[]) ?? []).map((f) => {\n const aid = uuid()\n files.get(t.id)!.push({ id: aid, request_id: t.id, storage_path: `${tenant}/${t.id}/${aid}/${f.name}`, name: f.name, size_bytes: f.size_bytes, content_type: f.content_type, created_at: iso(), url: null })\n return { attachment_id: aid, name: f.name, storage_path: `${tenant}/${t.id}/${aid}/${f.name}`, upload_url: null }\n })\n return { id: t.id, number: t.number, conversation_id: t.conversation_id, uploads }\n }\n case 'reply': {\n const t = find(args.request_id)\n if (['closed', 'cancelled'].includes(t.status)) throw new MockError('Esta solicitação está encerrada.')\n say(t.id, false, String(args.body ?? ''))\n if (t.status === 'waiting_you') touch(t, 'in_service')\n return { conversation_id: t.conversation_id, messages: messages.get(t.id) }\n }\n case 'status': {\n const t = find(args.request_id)\n if (args.action === 'cancel') {\n if (!['received', 'triage', 'waiting_you'].includes(t.status)) throw new MockError('Esta solicitação não pode mais ser cancelada.')\n touch(t, 'cancelled'); event(t.id, 'cancelled')\n } else if (t.status !== 'resolved_check') {\n // The bridge's rule (support 030 'status'): only a request waiting on the\n // person's confirmation takes \"Ficou bom\" / \"Ainda não\". The mock used to\n // accept it on a running chat — and so the tests never saw the refusal\n // that locked \"Encerrar\" in the V1.\n throw new MockError('Esta solicitação não está esperando a sua confirmação.')\n } else if (args.action === 'accept') {\n touch(t, 'closed'); event(t.id, 'validated_ok')\n } else {\n touch(t, 'received'); event(t.id, 'reopened', (args.reason as string) ?? null)\n }\n return row(t)\n }\n case 'chat_availability': {\n const active = tickets.find((t) => t.kind === 'chat' && !['resolved_check', 'closed', 'cancelled'].includes(t.status))\n return {\n home_id: 'mock-central', enabled: true, online: seed.online ?? 1,\n offline_message: 'Abra uma solicitação e respondemos por aqui e por e-mail.',\n business_hours: {}, timezone: 'America/Sao_Paulo',\n active_chat: active ? { id: active.id, number: active.number } : null,\n }\n }\n case 'chat_open': {\n const active = tickets.find((t) => t.kind === 'chat' && !['resolved_check', 'closed', 'cancelled'].includes(t.status))\n if (active) return { id: active.id, number: active.number, conversation_id: active.conversation_id, reused: true }\n const t = add('chat', String(args.subject ?? '') || 'Conversa com atendente', String(args.description ?? '') || 'A pessoa pediu para falar com um atendente.', 'received', 0)\n chatOpenedAt.set(t.id, Date.now())\n return { id: t.id, number: t.number, conversation_id: t.conversation_id, reused: false }\n }\n case 'chat': {\n const t = find(args.request_id)\n tick(t)\n const waiting = t.kind === 'chat' && !t.assignee && !['resolved_check', 'closed', 'cancelled'].includes(t.status)\n return {\n state: {\n id: t.id, number: t.number, kind: t.kind, status: t.status, waiting, position: waiting ? 1 : null,\n team_replied: (messages.get(t.id) ?? []).some((m) => m.author_kind === 'team'),\n agent_name: t.assignee ? String(t.assignee).split(' ')[0] : null, conversation_id: t.conversation_id, home_id: 'mock-central',\n },\n messages: messages.get(t.id),\n }\n }\n default:\n throw new MockError(`operação desconhecida: ${op}`)\n }\n }\n}\n","// `@fayz-ai/plugin-support/host` — the requester's support screens for a host\n// that does not run AdminShell nor the plugin runtime (the V1 drawing them slot\n// by slot), the way `@fayz-ai/plugin-getting-started/host` hosts the journey.\n//\n// The screens are the platform's own (SupportRequestsPanel, SupportMenu,\n// SupportRequestForm, SupportRequestDetail, LiveChatPanel); only the data port\n// changes: `dataProvider` is injected and nothing below touches this pool's\n// Supabase client. A host whose browser has no session here builds it with\n// `createSupportHostProvider({ call })` over its own transport — the V1 sends\n// each operation through its edge `support-v2`, signed to the V2 bridge\n// (`support.host`, @fayz-ai/contracts/v1-bridge) — and the ticket is born and\n// lives in the V2 (plugin-support 030).\nimport * as React from 'react'\nimport { registerTranslations, type PluginAITool } from '@fayz-ai/core'\nimport { supportLocales } from './locales'\nimport { useSupportStore } from './store'\nimport { setSupportDataProvider, type SupportDataProvider } from './data/provider'\nimport { SupportRequestsPanel, type SupportRequestsPanelProps } from './views/SupportRequestsPanel'\nimport { SupportRequestForm, type SupportRequestFormProps } from './views/SupportRequestForm'\nimport { SupportRequestDetail, type SupportRequestDetailProps } from './views/SupportRequestDetail'\nimport { SupportMenu, type SupportMenuProps } from './views/SupportMenu'\nimport { LiveChatPanel, type LiveChatPanelProps } from './livechat/LiveChatPanel'\nimport { useLiveChatDoor, type LiveChatDoor } from './livechat/door'\nimport { supportAITools } from './lib/report-tool'\nimport { installSupportInChat, refreshSupportHandler } from './livechat/in-chat-install'\n\nexport interface SupportHostOptions {\n /** Where every read and write goes. Required: there is no platform default in a host. */\n dataProvider: SupportDataProvider\n /** \"Toda a empresa\" — the host's own permission (the V1: support_tickets_license). Default false. */\n canSeeAll?: boolean\n /**\n * Install the support INSIDE the assistant's conversation (default true): the\n * support chips with their deterministic paths, the cards in the thread, the\n * header's \"Atendente\" turning the same thread into the live chat, and the\n * executors of `aiTools` (registerAIToolHandler). A host whose assistant is\n * the SDK chat leaves it on; it is what makes the V1 and the V2 the same.\n */\n inChat?: boolean\n}\n\nexport interface SupportHost {\n provider: SupportDataProvider\n /** \"Minhas solicitações\": list ↔ detail ↔ menu ↔ form ↔ live chat, in one column. */\n RequestsPanel: React.ComponentType<SupportRequestsPanelProps>\n /** The four doors (\"Em que podemos ajudar?\"). */\n Menu: React.ComponentType<SupportMenuProps>\n /** One door's form (description, subject, prints and files). */\n RequestForm: React.ComponentType<SupportRequestFormProps>\n /** The selected request (use the store's `select(id)` first, or the panel). */\n RequestDetail: React.ComponentType<SupportRequestDetailProps>\n /** \"Conversar com um atendente\": connecting, the absence screen, the chat. */\n LiveChatPanel: React.ComponentType<LiveChatPanelProps>\n /** The door's state (who is online, the open chat) for a host's own button. */\n useLiveChatDoor: (refreshKey?: unknown) => LiveChatDoor\n /** Opens a request in the store (the detail surface reads it). */\n select: (id: string | null) => Promise<void>\n /**\n * The support tools for the assistant's catalog (reportIssue,\n * findSupportRequests, startLiveChat, openSupportRequest) — the V1 declares\n * them with `registerModuleAITools` so its brain can call them; the executors\n * are already registered (inChat).\n */\n aiTools: PluginAITool[]\n /** Re-checks whether this account has a live chat and (un)registers the header's \"Atendente\". */\n refreshSupportHandler: () => Promise<boolean>\n /** Restores the platform provider and empties the store. */\n dispose: () => void\n}\n\nexport function createSupportHost(options: SupportHostOptions): SupportHost {\n registerTranslations(supportLocales)\n setSupportDataProvider(options.dataProvider)\n useSupportStore.getState().reset()\n\n const canSeeAll = options.canSeeAll ?? false\n const uninstall = options.inChat === false ? null : installSupportInChat()\n if (uninstall) void refreshSupportHandler()\n function RequestsPanel(props: SupportRequestsPanelProps) {\n return <SupportRequestsPanel canSeeAll={canSeeAll} {...props} />\n }\n RequestsPanel.displayName = 'SupportHost(RequestsPanel)'\n\n return {\n provider: options.dataProvider,\n RequestsPanel,\n Menu: SupportMenu,\n RequestForm: SupportRequestForm,\n RequestDetail: SupportRequestDetail,\n LiveChatPanel,\n useLiveChatDoor,\n select: (id) => useSupportStore.getState().select(id),\n aiTools: supportAITools,\n refreshSupportHandler,\n dispose: () => {\n uninstall?.()\n setSupportDataProvider(null)\n useSupportStore.getState().reset()\n },\n }\n}\n\nexport { createSupportHostProvider, toHostRequest, type SupportHostTransport, type SupportHostProviderOptions } from './data/host-provider'\nexport { createMockSupportHostTransport, type MockSupportHostSeed } from './data/mock-host'\nexport type { SupportDataProvider, ChatThreadMessage } from './data/provider'\nexport { useSupportStore } from './store'\nexport { requestLiveChat, useLiveChatDoor, liveChatHint, type LiveChatHandoff, type LiveChatDoor } from './livechat/door'\nexport { buildTranscript, chatSubject, type TranscriptMessage } from './livechat/rules'\nexport { supportAITools, supportToolHandlers, SUPPORT_DOOR_SUGGESTIONS } from './lib/report-tool'\nexport { installSupportInChat, refreshSupportHandler, getInChatController } from './livechat/in-chat-install'\nexport { stepInChat, statusLine, INITIAL_IN_CHAT, type InChatState, type InChatPhase, type InChatEvent } from './livechat/in-chat-machine'\nexport type { SupportRequestsPanelProps } from './views/SupportRequestsPanel'\nexport type { SupportRailChrome } from './lib/rail-chrome'\nexport type { SupportRequestFormProps } from './views/SupportRequestForm'\nexport type { SupportRequestDetailProps } from './views/SupportRequestDetail'\nexport type { SupportMenuProps } from './views/SupportMenu'\nexport type { LiveChatPanelProps } from './livechat/LiveChatPanel'\nexport type { ChatAvailability, ChatState } from './livechat/api'\nexport * from './types'\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { getInChatController, getRequestFlow, installSupportInChat, refreshSupportHandler, supportInChatActive } from './chunk-QBOQYER7.js';
|
|
2
|
+
import './chunk-JOS2QQML.js';
|
|
3
|
+
import './chunk-Y673XGDK.js';
|
|
4
|
+
import './chunk-WHEJ63CM.js';
|
|
5
|
+
import './chunk-S766CRAY.js';
|
|
6
|
+
import './chunk-ZEHBREG5.js';
|
|
7
|
+
import './chunk-3WPESEK2.js';
|
|
8
|
+
import './chunk-PHIPTZSD.js';
|
|
9
|
+
import './chunk-L2HGTGW4.js';
|
|
10
|
+
//# sourceMappingURL=in-chat-install-2BTKBF2Z.js.map
|
|
11
|
+
//# sourceMappingURL=in-chat-install-2BTKBF2Z.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"in-chat-install-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"in-chat-install-2BTKBF2Z.js"}
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { defaultStatusComponents, defaultWhatsNew, defaultFaq } from './chunk-5WQPAYG4.js';
|
|
2
|
+
import { setConversationSurface, setSlaPolicySource, supportSettingsPath, SETTINGS_TAB_ID, LEGACY_SETTINGS_SEGMENT } from './chunk-E5EXC7QW.js';
|
|
3
|
+
export { LiveChatQueue, supportSettingsPath } from './chunk-E5EXC7QW.js';
|
|
3
4
|
import { setSupportSettingsProvider, getSupportSettings } from './chunk-WM5SYARV.js';
|
|
4
5
|
export { SupportSettingsError, createMockSupportSettingsProvider, createSupabaseSupportSettingsProvider, getMySupportAgent, getSupportAccess, getSupportSettings, listSupportAgents } from './chunk-WM5SYARV.js';
|
|
5
6
|
import { supportLocales } from './chunk-7RHEXUVI.js';
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
export {
|
|
10
|
-
|
|
11
|
-
export { useSupportStore } from './chunk-MGBQNKCH.js';
|
|
12
|
-
export { MAX_ATTACHMENTS, MAX_ATTACHMENT_BYTES, SUPPORT_BUCKET, acceptChat, buildTranscript, chatAvailability, chatQueue, chatState, chatSubject, closeChat, openChat } from './chunk-77VZVUK3.js';
|
|
7
|
+
export { LiveChatPanel } from './chunk-DTO5R6GN.js';
|
|
8
|
+
import './chunk-E5242OSS.js';
|
|
9
|
+
import { registerSupportAITools, supportAITools } from './chunk-Y673XGDK.js';
|
|
10
|
+
export { useSupportStore } from './chunk-WHEJ63CM.js';
|
|
11
|
+
export { MAX_ATTACHMENTS, MAX_ATTACHMENT_BYTES, SUPPORT_BUCKET, acceptChat, buildTranscript, chatAvailability, chatQueue, chatState, chatSubject, closeChat, openChat } from './chunk-S766CRAY.js';
|
|
13
12
|
export { SUPPORT_SETTINGS_DEFAULTS, WEEKDAY_LABEL, describeBusinessHours, isWithinBusinessHours, slaTargets } from './chunk-ZEHBREG5.js';
|
|
14
13
|
import './chunk-3WPESEK2.js';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
14
|
+
import { helpdeskConsolePath, setHelpdeskConsolePath } from './chunk-3BKE4U6Y.js';
|
|
15
|
+
import { consoleListRequests, ticketsForConversation } from './chunk-PHIPTZSD.js';
|
|
16
|
+
import { STATUS_LABEL, STATUS_TONE } from './chunk-L2HGTGW4.js';
|
|
17
17
|
import React2 from 'react';
|
|
18
18
|
import { lazyComponent, registerTranslations, navigateApp, replaceApp } from '@fayz-ai/core';
|
|
19
19
|
import { MIGRATIONS } from '#migrations/main';
|
|
@@ -187,14 +187,14 @@ var supportConversationLinks = {
|
|
|
187
187
|
canAct: canOpen && conversation.channel !== "support" && !!conversation.contactPersonId
|
|
188
188
|
};
|
|
189
189
|
},
|
|
190
|
-
Action: lazyComponent(() => import('./OpenTicketFromConversation-
|
|
190
|
+
Action: lazyComponent(() => import('./OpenTicketFromConversation-RC26KHN3.js').then((m) => m.OpenTicketFromConversation))
|
|
191
191
|
};
|
|
192
192
|
|
|
193
193
|
// src/index.ts
|
|
194
|
-
var LazySupportCenter = React2.lazy(() => import('./SupportCenter-
|
|
195
|
-
var LazyHelpdeskConsole = React2.lazy(() => import('./HelpdeskConsole-
|
|
196
|
-
var LazySupportSettings = React2.lazy(() => import('./SupportSettingsPage-
|
|
197
|
-
var LazyLiveChatWatcher = React2.lazy(() => import('./LiveChatAgentWatcher-
|
|
194
|
+
var LazySupportCenter = React2.lazy(() => import('./SupportCenter-HGQL4PBX.js'));
|
|
195
|
+
var LazyHelpdeskConsole = React2.lazy(() => import('./HelpdeskConsole-EATEBVLN.js'));
|
|
196
|
+
var LazySupportSettings = React2.lazy(() => import('./SupportSettingsPage-LIVZY2XQ.js'));
|
|
197
|
+
var LazyLiveChatWatcher = React2.lazy(() => import('./LiveChatAgentWatcher-WEUHRRLC.js'));
|
|
198
198
|
var LiveChatWatcherControl = () => React2.createElement(React2.Suspense, { fallback: null }, React2.createElement(LazyLiveChatWatcher, null));
|
|
199
199
|
var SupportSettingsTab = () => React2.createElement(
|
|
200
200
|
React2.Suspense,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { SupportAttachment } from '../types';
|
|
2
|
+
/** Marks the board tickets whose id is in `importedIds`. */
|
|
3
|
+
export declare function markImported<T extends {
|
|
4
|
+
id: string;
|
|
5
|
+
imported?: boolean;
|
|
6
|
+
}>(tickets: T[], importedIds: readonly string[]): T[];
|
|
7
|
+
export interface ImportedAttachmentSplit {
|
|
8
|
+
/** Files in the V2 bucket (the V2's own, and the copied V1 ones). */
|
|
9
|
+
stored: SupportAttachment[];
|
|
10
|
+
/** V1 files of which only the name came over. */
|
|
11
|
+
inV1: SupportAttachment[];
|
|
12
|
+
/** V1 attachment ids already copied to the V2 (left out of the live V1 list). */
|
|
13
|
+
copiedIds: Set<string>;
|
|
14
|
+
}
|
|
15
|
+
export declare function splitImportedAttachments(attachments: readonly SupportAttachment[]): ImportedAttachmentSplit;
|
|
16
|
+
/**
|
|
17
|
+
* The live V1 list (null = the V1 could not answer) against what the import
|
|
18
|
+
* brought: `live` = what the V1 links, minus the copied files; `names` = the
|
|
19
|
+
* imported names the V1 did not link (V1 off, file gone) — shown "no V1".
|
|
20
|
+
*/
|
|
21
|
+
export declare function mergeV1Attachments<L extends {
|
|
22
|
+
id: string;
|
|
23
|
+
}>(live: readonly L[] | null, split: Pick<ImportedAttachmentSplit, 'inV1' | 'copiedIds'>): {
|
|
24
|
+
live: L[];
|
|
25
|
+
names: SupportAttachment[];
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=imported.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imported.d.ts","sourceRoot":"","sources":["../../src/lib/imported.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAajD,4DAA4D;AAC5D,wBAAgB,YAAY,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,CAAC,EAAE,CAI5H;AAED,MAAM,WAAW,uBAAuB;IACtC,qEAAqE;IACrE,MAAM,EAAE,iBAAiB,EAAE,CAAA;IAC3B,iDAAiD;IACjD,IAAI,EAAE,iBAAiB,EAAE,CAAA;IACzB,iFAAiF;IACjF,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CACvB;AAED,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,SAAS,iBAAiB,EAAE,GAAG,uBAAuB,CAU3G;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,EACzD,IAAI,EAAE,SAAS,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,uBAAuB,EAAE,MAAM,GAAG,WAAW,CAAC,GACpF;IAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAAC,KAAK,EAAE,iBAAiB,EAAE,CAAA;CAAE,CAI3C"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PluginAITool } from '@fayz-ai/core';
|
|
2
|
+
import type { SupportKind } from '../types';
|
|
2
3
|
/** What the tools need from the in-chat mode (the live chat, the cards). Set by installSupportInChat. */
|
|
3
4
|
export interface SupportToolBridge {
|
|
4
5
|
takeTurnFiles: () => File[];
|
|
@@ -36,6 +37,18 @@ export interface ReportIssueResult {
|
|
|
36
37
|
* (`supportData()` — the platform's RPCs, or a host's provider: the V1's edge),
|
|
37
38
|
* attaches the files of the turn and hands back the number plus the card the
|
|
38
39
|
* chat shows ("Solicitação #N registrada"). */
|
|
40
|
+
/** One request through the support data port, with what the person attached: what every path registers through. */
|
|
41
|
+
export declare function createSupportRequest(input: {
|
|
42
|
+
kind: SupportKind;
|
|
43
|
+
description: string;
|
|
44
|
+
subject?: string | null;
|
|
45
|
+
files?: File[];
|
|
46
|
+
route?: string | null;
|
|
47
|
+
snapshot?: Record<string, unknown>;
|
|
48
|
+
}): Promise<{
|
|
49
|
+
id: string;
|
|
50
|
+
number: number;
|
|
51
|
+
}>;
|
|
39
52
|
export declare function executeReportIssue(args: Record<string, unknown>): Promise<ReportIssueResult>;
|
|
40
53
|
/** Read-plane executor: the user's requests, ranked by how well they match the
|
|
41
54
|
* complaint, so the agent can see "this is already #N" before duplicating —
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report-tool.d.ts","sourceRoot":"","sources":["../../src/lib/report-tool.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"report-tool.d.ts","sourceRoot":"","sources":["../../src/lib/report-tool.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAIjD,OAAO,KAAK,EAAqB,WAAW,EAAE,MAAM,UAAU,CAAA;AAM9D,yGAAyG;AACzG,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,MAAM,IAAI,EAAE,CAAA;IAC3B,aAAa,EAA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eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,MAAM,CAAA;CAAE,CA6BvG,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAcxD,CAAA;AAED,mFAAmF;AACnF,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,gBAAgB,CAEzD,CAAA;AAKF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAS3D,CAAA;AAED,yCAAyC;AACzC,eAAO,MAAM,iBAAiB,EAAE,aAAa,EAE5C,CAAA;AAED,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,EAAE,eAAe,EAAwC,CAAA;AAEzF,sFAAsF;AACtF,wBAAgB,aAAa,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAgBjF;AAED,kEAAkE;AAClE,wBAAgB,SAAS,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAO7E;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAIzD"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { InChatController } from './in-chat';
|
|
2
|
+
import { RequestFlow } from './in-chat-request';
|
|
3
|
+
export declare function getRequestFlow(): RequestFlow;
|
|
2
4
|
export declare function getInChatController(): InChatController;
|
|
3
5
|
/**
|
|
4
6
|
* Idempotent (counted): the manifest and a host may both call it. Returns the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-chat-install.d.ts","sourceRoot":"","sources":["../../src/livechat/in-chat-install.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"in-chat-install.d.ts","sourceRoot":"","sources":["../../src/livechat/in-chat-install.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,gBAAgB,EAA0F,MAAM,WAAW,CAAA;AACpI,OAAO,EAAE,WAAW,EAA+C,MAAM,mBAAmB,CAAA;AA+D5F,wBAAgB,cAAc,IAAI,WAAW,CAoB5C;AAID,wBAAgB,mBAAmB,IAAI,gBAAgB,CAYtD;AAuCD;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,IAAI,CAUjD;AA0FD;;;;;GAKG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC,CAiB9D;AAgBD,uEAAuE;AACvE,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C"}
|
|
@@ -23,11 +23,14 @@ export type InChatEvent = {
|
|
|
23
23
|
t: 'start';
|
|
24
24
|
} | {
|
|
25
25
|
t: 'nobody';
|
|
26
|
-
}
|
|
26
|
+
}
|
|
27
|
+
/** `quiet`: this thread already says it (a second resume of the same chat draws no new line). */
|
|
28
|
+
| {
|
|
27
29
|
t: 'opened';
|
|
28
30
|
id: string;
|
|
29
31
|
number: number;
|
|
30
32
|
resumed?: boolean;
|
|
33
|
+
quiet?: boolean;
|
|
31
34
|
} | {
|
|
32
35
|
t: 'state';
|
|
33
36
|
snapshot: ChatSnapshot;
|
|
@@ -59,9 +62,15 @@ export type InChatEffect =
|
|
|
59
62
|
k: 'ask-rating';
|
|
60
63
|
by: 'team' | 'user';
|
|
61
64
|
}
|
|
62
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* The person ended it: close it on the server as far as this side can —
|
|
67
|
+
* `waiting` = leave the queue (cancel); otherwise end it / tell the team.
|
|
68
|
+
* Fire-and-forget: the thread is already back with the assistant.
|
|
69
|
+
*/
|
|
63
70
|
| {
|
|
64
|
-
k: '
|
|
71
|
+
k: 'leave';
|
|
72
|
+
requestId: string;
|
|
73
|
+
waiting: boolean;
|
|
65
74
|
}
|
|
66
75
|
/** Nobody online: the assistant says so and offers to leave a message. */
|
|
67
76
|
| {
|
|
@@ -77,6 +86,11 @@ export declare function stepInChat(state: InChatState, event: InChatEvent): {
|
|
|
77
86
|
state: InChatState;
|
|
78
87
|
effects: InChatEffect[];
|
|
79
88
|
};
|
|
89
|
+
/** The header's support button while the conversation runs ("Em atendimento · #44"; "#44" where narrow). */
|
|
90
|
+
export declare function headerLine(state: InChatState): {
|
|
91
|
+
label: string;
|
|
92
|
+
short: string;
|
|
93
|
+
} | null;
|
|
80
94
|
/** The strip's words for a state. */
|
|
81
95
|
export declare function statusLine(state: InChatState): {
|
|
82
96
|
status: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-chat-machine.d.ts","sourceRoot":"","sources":["../../src/livechat/in-chat-machine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"in-chat-machine.d.ts","sourceRoot":"","sources":["../../src/livechat/in-chat-machine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AA8B7C,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAA;AAE/F,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,WAAW,CAAA;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,oFAAoF;IACpF,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;IAChC,0EAA0E;IAC1E,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,eAAO,MAAM,eAAe,EAAE,WAE7B,CAAA;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,aAAa,CAAA;IAC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,CAAA;CAAE;AAClB,uDAAuD;GACrD;IAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAIjB,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAEvD;AAMD,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAEvD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,GAAG;IAAE,KAAK,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,YAAY,EAAE,CAAA;CAAE,CAiFlH;AAED,4GAA4G;AAC5G,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAUtF;AAED,qCAAqC;AACrC,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CASxF"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
export type RequestKind = 'problem' | 'improvement' | 'other';
|
|
2
|
+
export interface RequestQuestion {
|
|
3
|
+
key: string;
|
|
4
|
+
/** What the assistant asks. */
|
|
5
|
+
ask: string;
|
|
6
|
+
/** The row's name in the summary card. */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Quick replies (chips). Typing an answer instead is fine. */
|
|
9
|
+
options: string[];
|
|
10
|
+
}
|
|
11
|
+
export declare const REQUEST_QUESTIONS: Record<RequestKind, RequestQuestion[]>;
|
|
12
|
+
export declare const REQUEST_LABEL: Record<RequestKind, string>;
|
|
13
|
+
/** The composer's hint while the person describes it — the question itself. */
|
|
14
|
+
export declare const DESCRIBE_PLACEHOLDER: Record<RequestKind, string>;
|
|
15
|
+
export declare const REQUEST_INTRO: Record<RequestKind, string>;
|
|
16
|
+
export declare const MIN_DESCRIPTION = 5;
|
|
17
|
+
export type RequestPhase = 'idle' | 'describe' | 'thinking' | 'ask' | 'review' | 'sending';
|
|
18
|
+
export interface RequestScreen {
|
|
19
|
+
label: string | null;
|
|
20
|
+
route: string | null;
|
|
21
|
+
}
|
|
22
|
+
/** What the model made of the description (report-intake), as the steps use it. */
|
|
23
|
+
export interface RequestIntake {
|
|
24
|
+
onTopic: boolean;
|
|
25
|
+
reply: string | null;
|
|
26
|
+
title: string;
|
|
27
|
+
summary: string;
|
|
28
|
+
question: {
|
|
29
|
+
ask: string;
|
|
30
|
+
label: string;
|
|
31
|
+
options: string[];
|
|
32
|
+
} | null;
|
|
33
|
+
}
|
|
34
|
+
export interface RequestState {
|
|
35
|
+
phase: RequestPhase;
|
|
36
|
+
kind: RequestKind;
|
|
37
|
+
description: string;
|
|
38
|
+
answers: Record<string, string>;
|
|
39
|
+
/** Index of the question being asked (phase 'ask'). */
|
|
40
|
+
q: number;
|
|
41
|
+
/** Back from "Ajustar": after the new text, straight to the summary. */
|
|
42
|
+
adjusting: boolean;
|
|
43
|
+
/** The model reads the description first. False = the fixed questions only. */
|
|
44
|
+
smart: boolean;
|
|
45
|
+
/** The model's title and summary for the team (smart only). */
|
|
46
|
+
title: string;
|
|
47
|
+
summary: string;
|
|
48
|
+
/** The model's one follow-up, asked before the fixed questions. */
|
|
49
|
+
extra: RequestQuestion | null;
|
|
50
|
+
/** The screen the report is about, known without asking. */
|
|
51
|
+
screen: RequestScreen | null;
|
|
52
|
+
/** Off-topic texts already sent back (once; the next one goes as written). */
|
|
53
|
+
redirects: number;
|
|
54
|
+
}
|
|
55
|
+
export declare const INITIAL_REQUEST: RequestState;
|
|
56
|
+
export declare const EXTRA_QUESTION_KEY = "extra";
|
|
57
|
+
export type RequestEvent = {
|
|
58
|
+
t: 'start';
|
|
59
|
+
kind: RequestKind;
|
|
60
|
+
description?: string;
|
|
61
|
+
smart?: boolean;
|
|
62
|
+
screen?: RequestScreen | null;
|
|
63
|
+
}
|
|
64
|
+
/** The model's reading of the description (phase 'thinking'). */
|
|
65
|
+
| {
|
|
66
|
+
t: 'intake';
|
|
67
|
+
result: RequestIntake;
|
|
68
|
+
}
|
|
69
|
+
/** No reading: late, failed or not usable — the fixed questions take over. */
|
|
70
|
+
| {
|
|
71
|
+
t: 'intake_failed';
|
|
72
|
+
}
|
|
73
|
+
/** What the person typed in the composer (empty text with only a file is fine: nothing to read). */
|
|
74
|
+
| {
|
|
75
|
+
t: 'text';
|
|
76
|
+
text: string;
|
|
77
|
+
}
|
|
78
|
+
/** A chip of the current question. */
|
|
79
|
+
| {
|
|
80
|
+
t: 'choose';
|
|
81
|
+
value: string;
|
|
82
|
+
} | {
|
|
83
|
+
t: 'adjust';
|
|
84
|
+
} | {
|
|
85
|
+
t: 'send';
|
|
86
|
+
} | {
|
|
87
|
+
t: 'sent';
|
|
88
|
+
number: number;
|
|
89
|
+
} | {
|
|
90
|
+
t: 'failed';
|
|
91
|
+
message: string;
|
|
92
|
+
} | {
|
|
93
|
+
t: 'cancel';
|
|
94
|
+
};
|
|
95
|
+
export type RequestEffect =
|
|
96
|
+
/** A line from the assistant (with quick replies when the step has them). */
|
|
97
|
+
{
|
|
98
|
+
k: 'say';
|
|
99
|
+
text: string;
|
|
100
|
+
options?: string[];
|
|
101
|
+
}
|
|
102
|
+
/** The intro of a door (the controller adds the print chip to a problem). */
|
|
103
|
+
| {
|
|
104
|
+
k: 'intro';
|
|
105
|
+
text: string;
|
|
106
|
+
}
|
|
107
|
+
/** The summary card with "Enviar" / "Ajustar". */
|
|
108
|
+
| {
|
|
109
|
+
k: 'summary';
|
|
110
|
+
}
|
|
111
|
+
/** Put the description back in the field to be rewritten. */
|
|
112
|
+
| {
|
|
113
|
+
k: 'prefill';
|
|
114
|
+
text: string;
|
|
115
|
+
}
|
|
116
|
+
/** Ask the model to read the description (the controller answers with intake / intake_failed). */
|
|
117
|
+
| {
|
|
118
|
+
k: 'intake';
|
|
119
|
+
} | {
|
|
120
|
+
k: 'create';
|
|
121
|
+
} | {
|
|
122
|
+
k: 'done';
|
|
123
|
+
number: number;
|
|
124
|
+
} | {
|
|
125
|
+
k: 'cancelled';
|
|
126
|
+
};
|
|
127
|
+
export declare function isRequestActive(state: RequestState): boolean;
|
|
128
|
+
/** The questions this request asks, in order: the model's one first, then the fixed ones. */
|
|
129
|
+
export declare function questionsOf(state: RequestState): RequestQuestion[];
|
|
130
|
+
export declare function stepRequest(state: RequestState, event: RequestEvent): {
|
|
131
|
+
state: RequestState;
|
|
132
|
+
effects: RequestEffect[];
|
|
133
|
+
};
|
|
134
|
+
/** The composer's hint at each step. */
|
|
135
|
+
export declare function requestPlaceholder(state: RequestState): string;
|
|
136
|
+
/** The summary rows: the screen when known without asking, then the answers in the order asked. */
|
|
137
|
+
export declare function requestDetails(state: RequestState): Array<{
|
|
138
|
+
label: string;
|
|
139
|
+
value: string;
|
|
140
|
+
}>;
|
|
141
|
+
/**
|
|
142
|
+
* What the team reads. With the model: its summary, the rows, and the person's
|
|
143
|
+
* words verbatim at the end. Without: the person's words first, the answers
|
|
144
|
+
* under them. The words are never rewritten either way.
|
|
145
|
+
*/
|
|
146
|
+
export declare function requestDescription(state: RequestState, route?: string | null): string;
|
|
147
|
+
//# sourceMappingURL=in-chat-request-machine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-chat-request-machine.d.ts","sourceRoot":"","sources":["../../src/livechat/in-chat-request-machine.ts"],"names":[],"mappings":"AAsBA,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,aAAa,GAAG,OAAO,CAAA;AAE7D,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAA;IACX,+BAA+B;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAA;IACb,+DAA+D;IAC/D,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,WAAW,EAAE,e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