@burdenoff/microfe-support 2026.1014.10 → 2026.1029.2

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.
@@ -22,7 +22,7 @@ var s = ({ ticketId: s, messages: c, currentUserId: l, viewerRole: u = "customer
22
22
  label: p("support.shared.messageType.system", "System"),
23
23
  isAgent: !0
24
24
  }
25
- }, h = d ? c : c.filter((e) => !e.isInternal);
25
+ }, h = (d ? c : c.filter((e) => !e.isInternal)).filter((e) => !e.isDraft);
26
26
  return !h || h.length === 0 ? /* @__PURE__ */ o("div", {
27
27
  className: "flex flex-col items-center justify-center py-12",
28
28
  children: [/* @__PURE__ */ a("p", {
@@ -1 +1 @@
1
- {"version":3,"file":"MessageThread.js","names":[],"sources":["../../../../src/support/components/tickets/MessageThread.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { User, Lock } from 'lucide-react';\nimport type { SupportMessage, MessageType } from '../../../generated/global-types';\nimport { AttachmentList } from './AttachmentList';\nimport { MarkdownContent } from './MarkdownContent';\nimport { useTr } from '../../hooks/useTr';\n\ninterface MessageThreadProps {\n ticketId: string;\n messages: SupportMessage[];\n currentUserId?: string;\n viewerRole?: 'customer' | 'agent';\n showInternalMessages?: boolean;\n showRealAgentIdentity?: boolean;\n}\n\nexport const MessageThread: FC<MessageThreadProps> = ({\n ticketId,\n messages,\n currentUserId,\n viewerRole = 'customer',\n showInternalMessages = false,\n showRealAgentIdentity = false,\n}) => {\n const tr = useTr();\n const messageTypeConfig: Record<MessageType, { label: string; isAgent: boolean }> = {\n CUSTOMER_REPLY: {\n label: tr('support.shared.messageType.customer', 'Customer'),\n isAgent: false,\n },\n AGENT_REPLY: { label: tr('support.shared.messageType.agent', 'Agent'), isAgent: true },\n INTERNAL_NOTE: {\n label: tr('support.shared.messageType.internalNote', 'Internal Note'),\n isAgent: true,\n },\n SYSTEM_MESSAGE: { label: tr('support.shared.messageType.system', 'System'), isAgent: true },\n };\n\n const visibleMessages = showInternalMessages\n ? messages\n : messages.filter((msg) => !msg.isInternal);\n\n if (!visibleMessages || visibleMessages.length === 0) {\n return (\n <div className=\"flex flex-col items-center justify-center py-12\">\n <p className=\"text-lg text-text-secondary\">\n {tr('support.messageThread.empty.title', 'No messages yet')}\n </p>\n <p className=\"text-sm mt-2 text-text-secondary/70\">\n {tr(\n 'support.messageThread.empty.description',\n 'Start the conversation by sending a message'\n )}\n </p>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4\">\n {visibleMessages.map((msg) => {\n const isCurrentUser = msg.authorId === currentUserId;\n const typeConfig = messageTypeConfig[msg.type] || messageTypeConfig.SYSTEM_MESSAGE;\n const isCustomer = msg.type === 'CUSTOMER_REPLY';\n const isAgentMessage = typeConfig.isAgent && msg.type !== 'SYSTEM_MESSAGE';\n const alignEnd = viewerRole === 'agent' ? isAgentMessage : isCustomer;\n const isInternal = msg.isInternal || msg.type === 'INTERNAL_NOTE';\n const customContext =\n (msg.context?.custom as Record<string, unknown> | null | undefined) ?? undefined;\n // Privacy: prefer the backend-resolved `author` projection — it gates\n // real-vs-alias identity by viewer actor type. Fall back to the legacy\n // `context.custom` snapshot for older messages where `author` is null.\n const author =\n (\n msg as {\n author?: {\n displayName: string;\n avatar: string;\n isAnonymized: boolean;\n kind: string;\n } | null;\n }\n ).author ?? null;\n // The backend has the AUTHORITATIVE privacy decision. If it says\n // `isAnonymized`, we MUST NOT reach back into `context.custom` to\n // recover the real name — the prop `showRealAgentIdentity` is only a\n // UI preference for callers that are already in the admin context.\n const backendAnonymized = author ? author.isAnonymized : true;\n const agentAlias =\n author?.displayName ??\n (customContext?.authorAlias as string | undefined) ??\n tr('support.messageThread.agentAlias', 'Support Agent');\n const realAgentName = backendAnonymized\n ? agentAlias\n : author\n ? author.displayName\n : showRealAgentIdentity\n ? ((customContext?.authorName as string | undefined) ??\n (customContext?.authorEmail as string | undefined) ??\n msg.authorId)\n : agentAlias;\n const displayName =\n msg.type === 'AGENT_REPLY'\n ? showRealAgentIdentity && !backendAnonymized\n ? realAgentName\n : agentAlias\n : msg.type === 'CUSTOMER_REPLY'\n ? isCurrentUser\n ? tr('support.messageThread.you', 'You')\n : tr('support.messageThread.customer', 'Customer')\n : typeConfig.label;\n\n return (\n <div key={msg.id} className={`flex ${alignEnd ? 'justify-end' : 'justify-start'}`}>\n <div\n className={`max-w-[90%] rounded-lg p-4 sm:max-w-[70%] ${\n isInternal\n ? 'border-2 border-status-warning-bg bg-status-warning-bg-subtle'\n : isCustomer\n ? 'bg-bg-sunken'\n : 'bg-action-primary-bg/10'\n }`}\n >\n {/* Message header */}\n <div className=\"flex items-center gap-2 mb-2\">\n <div\n className={`w-8 h-8 rounded-full flex items-center justify-center transition-colors duration-200 ${\n isCustomer ? 'bg-accent/10' : 'bg-action-primary-bg/20'\n }`}\n >\n <User size={16} className={isCustomer ? 'text-accent' : 'text-primary'} />\n </div>\n <div className=\"flex-1\">\n <div className=\"flex items-center gap-2\">\n <span className=\"font-medium text-sm text-text-primary\">{displayName}</span>\n {isInternal && (\n <span className=\"text-xs px-2 py-0.5 rounded flex items-center gap-1 bg-status-warning-bg text-on-accent\">\n <Lock size={10} />\n {tr('support.messageThread.internalBadge', 'Internal')}\n </span>\n )}\n </div>\n <span className=\"text-xs text-text-secondary\">\n {new Date(msg.createdAt).toLocaleString()}\n </span>\n </div>\n </div>\n\n {/* Message content */}\n <MarkdownContent content={msg.message} className=\"text-sm\" />\n\n <div className=\"mt-3\">\n <AttachmentList fileIds={msg.attachments || []} ticketId={ticketId} />\n </div>\n </div>\n </div>\n );\n })}\n </div>\n );\n};\n"],"mappings":";;;;;;AAgBA,IAAa,KAAyC,EACpD,aACA,aACA,kBACA,gBAAa,YACb,0BAAuB,IACvB,2BAAwB,SACpB;CACJ,IAAM,IAAK,EAAM,GACX,IAA8E;EAClF,gBAAgB;GACd,OAAO,EAAG,uCAAuC,UAAU;GAC3D,SAAS;EACX;EACA,aAAa;GAAE,OAAO,EAAG,oCAAoC,OAAO;GAAG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;OAAK,WAAU;OAAf,UAAA,CACE,kBAAC,OAAD;QACE,WAAW,wFACT,IAAa,iBAAiB;QAGhC,UAAA,kBAAC,GAAD;SAAM,MAAM;SAAI,WAAW,IAAa,gBAAgB;QAAiB,CAAA;OACtE,CAAA,GACL,kBAAC,OAAD;QAAK,WAAU;QAAf,UAAA,CACE,kBAAC,OAAD;SAAK,WAAU;SAAf,UAAA,CACE,kBAAC,QAAD;UAAM,WAAU;UAAyC,UAAA;SAAkB,CAAA,GAC1E,KACC,kBAAC,QAAD;UAAM,WAAU;UAAhB,UAAA,CACE,kBAAC,GAAD,EAAM,MAAM,GAAK,CAAA,GAChB,EAAG,uCAAuC,UAAU,CACjD;SAEL,CAAA,CAAA;QACL,CAAA,GAAA,kBAAC,QAAD;SAAM,WAAU;SACb,UAAA,IAAI,KAAK,EAAI,SAAS,CAAC,CAAC,eAAe;QACpC,CAAA,CACH;OACF,CAAA,CAAA;;MAGL,kBAAC,GAAD;OAAiB,SAAS,EAAI;OAAS,WAAU;MAAW,CAAA;MAE5D,kBAAC,OAAD;OAAK,WAAU;OACb,UAAA,kBAAC,GAAD;QAAgB,SAAS,EAAI,eAAe,CAAC;QAAa;OAAW,CAAA;MAClE,CAAA;KACF;;GACF,GA1CK,EAAI,EA0CT;EAET,CAAC;CACE,CAAA;AAET"}
1
+ {"version":3,"file":"MessageThread.js","names":[],"sources":["../../../../src/support/components/tickets/MessageThread.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { User, Lock } from 'lucide-react';\nimport type { SupportMessage, MessageType } from '../../../generated/global-types';\nimport { AttachmentList } from './AttachmentList';\nimport { MarkdownContent } from './MarkdownContent';\nimport { useTr } from '../../hooks/useTr';\n\ninterface MessageThreadProps {\n ticketId: string;\n messages: SupportMessage[];\n currentUserId?: string;\n viewerRole?: 'customer' | 'agent';\n showInternalMessages?: boolean;\n showRealAgentIdentity?: boolean;\n}\n\nexport const MessageThread: FC<MessageThreadProps> = ({\n ticketId,\n messages,\n currentUserId,\n viewerRole = 'customer',\n showInternalMessages = false,\n showRealAgentIdentity = false,\n}) => {\n const tr = useTr();\n const messageTypeConfig: Record<MessageType, { label: string; isAgent: boolean }> = {\n CUSTOMER_REPLY: {\n label: tr('support.shared.messageType.customer', 'Customer'),\n isAgent: false,\n },\n AGENT_REPLY: { label: tr('support.shared.messageType.agent', 'Agent'), isAgent: true },\n INTERNAL_NOTE: {\n label: tr('support.shared.messageType.internalNote', 'Internal Note'),\n isAgent: true,\n },\n SYSTEM_MESSAGE: { label: tr('support.shared.messageType.system', 'System'), isAgent: true },\n };\n\n const visibleMessages = (\n showInternalMessages ? messages : messages.filter((msg) => !msg.isInternal)\n ).filter(\n // Reply drafts (BOFF-3646) are shown in the triage panel, not the thread.\n (msg) => !msg.isDraft\n );\n\n if (!visibleMessages || visibleMessages.length === 0) {\n return (\n <div className=\"flex flex-col items-center justify-center py-12\">\n <p className=\"text-lg text-text-secondary\">\n {tr('support.messageThread.empty.title', 'No messages yet')}\n </p>\n <p className=\"text-sm mt-2 text-text-secondary/70\">\n {tr(\n 'support.messageThread.empty.description',\n 'Start the conversation by sending a message'\n )}\n </p>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4\">\n {visibleMessages.map((msg) => {\n const isCurrentUser = msg.authorId === currentUserId;\n const typeConfig = messageTypeConfig[msg.type] || messageTypeConfig.SYSTEM_MESSAGE;\n const isCustomer = msg.type === 'CUSTOMER_REPLY';\n const isAgentMessage = typeConfig.isAgent && msg.type !== 'SYSTEM_MESSAGE';\n const alignEnd = viewerRole === 'agent' ? isAgentMessage : isCustomer;\n const isInternal = msg.isInternal || msg.type === 'INTERNAL_NOTE';\n const customContext =\n (msg.context?.custom as Record<string, unknown> | null | undefined) ?? undefined;\n // Privacy: prefer the backend-resolved `author` projection — it gates\n // real-vs-alias identity by viewer actor type. Fall back to the legacy\n // `context.custom` snapshot for older messages where `author` is null.\n const author =\n (\n msg as {\n author?: {\n displayName: string;\n avatar: string;\n isAnonymized: boolean;\n kind: string;\n } | null;\n }\n ).author ?? null;\n // The backend has the AUTHORITATIVE privacy decision. If it says\n // `isAnonymized`, we MUST NOT reach back into `context.custom` to\n // recover the real name — the prop `showRealAgentIdentity` is only a\n // UI preference for callers that are already in the admin context.\n const backendAnonymized = author ? author.isAnonymized : true;\n const agentAlias =\n author?.displayName ??\n (customContext?.authorAlias as string | undefined) ??\n tr('support.messageThread.agentAlias', 'Support Agent');\n const realAgentName = backendAnonymized\n ? agentAlias\n : author\n ? author.displayName\n : showRealAgentIdentity\n ? ((customContext?.authorName as string | undefined) ??\n (customContext?.authorEmail as string | undefined) ??\n msg.authorId)\n : agentAlias;\n const displayName =\n msg.type === 'AGENT_REPLY'\n ? showRealAgentIdentity && !backendAnonymized\n ? realAgentName\n : agentAlias\n : msg.type === 'CUSTOMER_REPLY'\n ? isCurrentUser\n ? tr('support.messageThread.you', 'You')\n : tr('support.messageThread.customer', 'Customer')\n : typeConfig.label;\n\n return (\n <div key={msg.id} className={`flex ${alignEnd ? 'justify-end' : 'justify-start'}`}>\n <div\n className={`max-w-[90%] rounded-lg p-4 sm:max-w-[70%] ${\n isInternal\n ? 'border-2 border-status-warning-bg bg-status-warning-bg-subtle'\n : isCustomer\n ? 'bg-bg-sunken'\n : 'bg-action-primary-bg/10'\n }`}\n >\n {/* Message header */}\n <div className=\"flex items-center gap-2 mb-2\">\n <div\n className={`w-8 h-8 rounded-full flex items-center justify-center transition-colors duration-200 ${\n isCustomer ? 'bg-accent/10' : 'bg-action-primary-bg/20'\n }`}\n >\n <User size={16} className={isCustomer ? 'text-accent' : 'text-primary'} />\n </div>\n <div className=\"flex-1\">\n <div className=\"flex items-center gap-2\">\n <span className=\"font-medium text-sm text-text-primary\">{displayName}</span>\n {isInternal && (\n <span className=\"text-xs px-2 py-0.5 rounded flex items-center gap-1 bg-status-warning-bg text-on-accent\">\n <Lock size={10} />\n {tr('support.messageThread.internalBadge', 'Internal')}\n </span>\n )}\n </div>\n <span className=\"text-xs text-text-secondary\">\n {new Date(msg.createdAt).toLocaleString()}\n </span>\n </div>\n </div>\n\n {/* Message content */}\n <MarkdownContent content={msg.message} className=\"text-sm\" />\n\n <div className=\"mt-3\">\n <AttachmentList fileIds={msg.attachments || []} ticketId={ticketId} />\n </div>\n </div>\n </div>\n );\n })}\n </div>\n );\n};\n"],"mappings":";;;;;;AAgBA,IAAa,KAAyC,EACpD,aACA,aACA,kBACA,gBAAa,YACb,0BAAuB,IACvB,2BAAwB,SACpB;CACJ,IAAM,IAAK,EAAM,GACX,IAA8E;EAClF,gBAAgB;GACd,OAAO,EAAG,uCAAuC,UAAU;GAC3D,SAAS;EACX;EACA,aAAa;GAAE,OAAO,EAAG,oCAAoC,OAAO;GAAG,SAAS;EAAK;EACrF,eAAe;GACb,OAAO,EAAG,2CAA2C,eAAe;GACpE,SAAS;EACX;EACA,gBAAgB;GAAE,OAAO,EAAG,qCAAqC,QAAQ;GAAG,SAAS;EAAK;CAC5F,GAEM,KACJ,IAAuB,IAAW,EAAS,QAAQ,MAAQ,CAAC,EAAI,UAAU,EAAA,CAC1E,QAEC,MAAQ,CAAC,EAAI,OAChB;CAkBA,OAhBI,CAAC,KAAmB,EAAgB,WAAW,IAE/C,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,kBAAC,KAAD;GAAG,WAAU;GACV,UAAA,EAAG,qCAAqC,iBAAiB;EACzD,CAAA,GACH,kBAAC,KAAD;GAAG,WAAU;GACV,UAAA,EACC,2CACA,6CACF;EACC,CAAA,CACA;MAKP,kBAAC,OAAD;EAAK,WAAU;EACZ,UAAA,EAAgB,KAAK,MAAQ;GAC5B,IAAM,IAAgB,EAAI,aAAa,GACjC,IAAa,EAAkB,EAAI,SAAS,EAAkB,gBAC9D,IAAa,EAAI,SAAS,kBAC1B,IAAiB,EAAW,WAAW,EAAI,SAAS,kBACpD,IAAW,MAAe,UAAU,IAAiB,GACrD,IAAa,EAAI,cAAc,EAAI,SAAS,iBAC5C,IACH,EAAI,SAAS,UAAyD,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;MAClE,CAAA;KACF;;GACF,GA1CK,EAAI,EA0CT;EAET,CAAC;CACE,CAAA;AAET"}
@@ -0,0 +1,21 @@
1
+ import { type FC } from 'react';
2
+ import { type ReplyDraftFieldsFragment, type TriageDecisionFieldsFragment } from '../../../generated/global-operations';
3
+ interface TriagePanelProps {
4
+ ticketId: string;
5
+ decision: TriageDecisionFieldsFragment | null | undefined;
6
+ draft: ReplyDraftFieldsFragment | null | undefined;
7
+ /** Category id → display name, for the decision summary. */
8
+ categoryNames: Record<string, string>;
9
+ /** Called after any change so the page can refetch the ticket. */
10
+ onChanged: () => Promise<unknown> | void;
11
+ notify: (type: 'success' | 'error' | 'info', message: string, durationMs?: number) => void;
12
+ }
13
+ /**
14
+ * Agent-only panel for the support triage engine (BOFF-3646).
15
+ *
16
+ * Shows what triage decided and why (evidence, signals, notes), lets the agent
17
+ * re-run it, and handles the KB-grounded reply draft: draft, edit, send, or
18
+ * discard. A draft is never sent without the agent pressing Send.
19
+ */
20
+ export declare const TriagePanel: FC<TriagePanelProps>;
21
+ export {};
@@ -0,0 +1,230 @@
1
+ import { useTr as e } from "../../hooks/useTr.js";
2
+ import { Badge as t, Button as n, EmphasisPanel as r, Textarea as i } from "../ui.js";
3
+ import { useGlobalDiscardTicketReplyDraftMutation as a, useGlobalDraftTicketReplyMutation as o, useGlobalSendTicketReplyDraftMutation as s, useGlobalTriageTicketMutation as c } from "../../../generated/global-operations.js";
4
+ import { ticketPriorityBadgeClasses as l } from "../../utils/uiTokens.js";
5
+ import { extractErrorCode as u, extractErrorMessage as d } from "../../utils/errors.js";
6
+ import { useEffect as f, useState as p } from "react";
7
+ import { FileText as m, Send as h, Sparkles as g, Trash2 as _, UserCheck as v } from "lucide-react";
8
+ import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
9
+ //#region src/support/components/tickets/TriagePanel.tsx
10
+ function S(e) {
11
+ let t = (e?.errors)?.[0]?.extensions?.code;
12
+ return typeof t == "string" ? t : u(e);
13
+ }
14
+ var C = ({ ticketId: u, decision: C, draft: w, categoryNames: T, onChanged: E, notify: D }) => {
15
+ let O = e(), [k, A] = p(w?.message ?? ""), [j, { loading: M }] = c(), [N, { loading: P }] = o(), [F, { loading: I }] = s(), [L, { loading: R }] = a(), z = M || P || I || R;
16
+ f(() => {
17
+ A(w?.message ?? "");
18
+ }, [w?.id, w?.message]);
19
+ let B = (e) => e ? T[e] ?? e : O("support.triage.noCategory", "No category"), V = async (e, t, n) => {
20
+ try {
21
+ let n = await e();
22
+ if (n.error) throw n.error;
23
+ await E(), D("success", t);
24
+ } catch (e) {
25
+ if (S(e) === "GROUNDING_INSUFFICIENT") {
26
+ D("info", O("support.triage.errors.noGrounding", "No published article or FAQ covers this ticket closely enough to draft a reply. Write this one by hand."), 8e3);
27
+ return;
28
+ }
29
+ D("error", d(e, n), 6e3);
30
+ }
31
+ }, H = () => V(() => j({ variables: { id: u } }), O("support.triage.triaged", "Ticket triaged."), O("support.triage.errors.triage", "Triage failed.")), U = () => V(() => N({ variables: { ticketId: u } }), O("support.triage.drafted", "Reply drafted from the knowledge base."), O("support.triage.errors.draft", "Could not draft a reply.")), W = () => {
32
+ if (!w) return;
33
+ let e = k.trim() === w.message.trim() ? void 0 : k;
34
+ return V(() => F({ variables: {
35
+ id: w.id,
36
+ message: e
37
+ } }), O("support.triage.sent", "Reply sent to the customer."), O("support.triage.errors.send", "Could not send the reply."));
38
+ }, G = () => {
39
+ if (w) return V(() => L({ variables: { id: w.id } }), O("support.triage.discarded", "Draft discarded."), O("support.triage.errors.discard", "Could not discard the draft."));
40
+ }, K = C ? Math.round(C.categoryConfidence * 100) : 0;
41
+ return /* @__PURE__ */ x(r, {
42
+ className: "mb-6 p-4",
43
+ "data-testid": "support-triage-panel",
44
+ children: [
45
+ /* @__PURE__ */ x("div", {
46
+ className: "mb-3 flex flex-wrap items-center justify-between gap-2",
47
+ children: [/* @__PURE__ */ x("h2", {
48
+ className: "flex items-center gap-2 text-lg font-semibold text-text-primary",
49
+ children: [/* @__PURE__ */ b(g, {
50
+ size: 18,
51
+ className: "text-primary"
52
+ }), O("support.triage.title", "Triage and reply draft")]
53
+ }), /* @__PURE__ */ x("div", {
54
+ className: "flex flex-wrap gap-2",
55
+ children: [/* @__PURE__ */ x(n, {
56
+ variant: "outline",
57
+ size: "sm",
58
+ onClick: () => void H(),
59
+ disabled: z,
60
+ "data-testid": "support-triage-run",
61
+ children: [/* @__PURE__ */ b(g, { size: 14 }), C ? O("support.triage.rerun", "Re-run triage") : O("support.triage.run", "Run triage")]
62
+ }), /* @__PURE__ */ x(n, {
63
+ variant: "outline",
64
+ size: "sm",
65
+ onClick: () => void U(),
66
+ disabled: z,
67
+ "data-testid": "support-triage-draft",
68
+ children: [/* @__PURE__ */ b(m, { size: 14 }), w ? O("support.triage.redraft", "Draft again") : O("support.triage.draft", "Draft reply")]
69
+ })]
70
+ })]
71
+ }),
72
+ C ? /* @__PURE__ */ x("div", {
73
+ className: "space-y-3 text-sm",
74
+ "data-testid": "support-triage-decision",
75
+ children: [
76
+ /* @__PURE__ */ x("div", {
77
+ className: "grid gap-3 sm:grid-cols-3",
78
+ children: [
79
+ /* @__PURE__ */ x("div", { children: [
80
+ /* @__PURE__ */ b("p", {
81
+ className: "text-xs text-text-secondary",
82
+ children: O("support.triage.category", "Category")
83
+ }),
84
+ /* @__PURE__ */ x("div", {
85
+ className: "font-medium text-text-primary",
86
+ children: [B(C.categoryId), C.categoryApplied && /* @__PURE__ */ b(t, {
87
+ variant: "outline",
88
+ className: "ml-2",
89
+ children: O("support.triage.setByTriage", "set by triage")
90
+ })]
91
+ }),
92
+ C.proposedCategoryId && /* @__PURE__ */ b("p", {
93
+ className: "text-xs text-text-secondary",
94
+ children: O("support.triage.confidence", "{{pct}}% of the evidence", { pct: K })
95
+ })
96
+ ] }),
97
+ /* @__PURE__ */ x("div", { children: [
98
+ /* @__PURE__ */ b("p", {
99
+ className: "text-xs text-text-secondary",
100
+ children: O("support.triage.priority", "Priority")
101
+ }),
102
+ /* @__PURE__ */ x("p", {
103
+ className: "flex flex-wrap items-center gap-1 font-medium text-text-primary",
104
+ children: [C.previousPriority !== C.priority && /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("span", {
105
+ className: "text-text-secondary line-through",
106
+ children: C.previousPriority
107
+ }), /* @__PURE__ */ b("span", {
108
+ className: "text-text-secondary",
109
+ children: "→"
110
+ })] }), /* @__PURE__ */ b("span", {
111
+ className: `rounded border px-2 py-0.5 text-xs ${l[C.priority]}`,
112
+ children: C.priority
113
+ })]
114
+ }),
115
+ C.prioritySignals.length > 0 && /* @__PURE__ */ b("p", {
116
+ className: "text-xs text-text-secondary",
117
+ children: C.prioritySignals.join(", ")
118
+ })
119
+ ] }),
120
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
121
+ className: "text-xs text-text-secondary",
122
+ children: O("support.triage.suggestedAgent", "Suggested agent")
123
+ }), C.suggestedAssignee ? /* @__PURE__ */ x("p", {
124
+ className: "flex items-center gap-1 font-medium text-text-primary",
125
+ children: [
126
+ /* @__PURE__ */ b(v, {
127
+ size: 14,
128
+ className: "text-primary"
129
+ }),
130
+ /* @__PURE__ */ b("span", {
131
+ className: "font-mono text-xs",
132
+ children: C.suggestedAssignee.userId.slice(0, 12)
133
+ }),
134
+ /* @__PURE__ */ b("span", {
135
+ className: "text-xs text-text-secondary",
136
+ children: C.suggestedAssignee.matchedSkills.length > 0 ? C.suggestedAssignee.matchedSkills.join(", ") : O("support.triage.lightestLoad", "lightest load")
137
+ })
138
+ ]
139
+ }) : /* @__PURE__ */ b("p", {
140
+ className: "text-text-secondary",
141
+ children: O("support.triage.none", "None")
142
+ })] })
143
+ ]
144
+ }),
145
+ C.evidence.length > 0 && /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
146
+ className: "mb-1 text-xs text-text-secondary",
147
+ children: O("support.triage.evidence", "Based on")
148
+ }), /* @__PURE__ */ b("ul", {
149
+ className: "flex flex-wrap gap-2",
150
+ "data-testid": "support-triage-evidence",
151
+ children: C.evidence.map((e) => /* @__PURE__ */ b("li", { children: /* @__PURE__ */ b(t, {
152
+ variant: "secondary",
153
+ children: e.kind === "TICKET" ? O("support.triage.evidenceTicket", "Ticket {{label}}", { label: e.label }) : O("support.triage.evidenceArticle", "Article: {{label}}", { label: e.label })
154
+ }) }, `${e.kind}:${e.id}`))
155
+ })] }),
156
+ C.notes.length > 0 && /* @__PURE__ */ b("ul", {
157
+ className: "list-disc space-y-0.5 pl-5 text-xs text-text-secondary",
158
+ children: C.notes.map((e) => /* @__PURE__ */ b("li", { children: e }, e))
159
+ }),
160
+ /* @__PURE__ */ b("p", {
161
+ className: "text-xs text-text-secondary",
162
+ children: C.trigger === "TICKET_CREATED" ? O("support.triage.autoRun", "Triaged automatically when the ticket arrived, {{at}}.", { at: new Date(C.decidedAt).toLocaleString() }) : O("support.triage.manualRun", "Triaged on request, {{at}}.", { at: new Date(C.decidedAt).toLocaleString() })
163
+ })
164
+ ]
165
+ }) : /* @__PURE__ */ b("p", {
166
+ className: "text-sm text-text-secondary",
167
+ children: O("support.triage.notTriaged", "This ticket has not been triaged yet. Run triage to fill its category, priority and SLA from similar resolved tickets.")
168
+ }),
169
+ w && /* @__PURE__ */ x("div", {
170
+ className: "mt-4 rounded-lg border border-border-subtle bg-bg-surface p-3",
171
+ "data-testid": "support-triage-reply-draft",
172
+ children: [
173
+ /* @__PURE__ */ x("div", {
174
+ className: "mb-2 flex items-center justify-between gap-2",
175
+ children: [/* @__PURE__ */ b("h3", {
176
+ className: "text-sm font-semibold text-text-primary",
177
+ children: O("support.triage.draftTitle", "Reply draft")
178
+ }), /* @__PURE__ */ b("span", {
179
+ className: "text-xs text-text-secondary",
180
+ children: O("support.triage.draftNotSent", "Not sent — only you can see this.")
181
+ })]
182
+ }),
183
+ /* @__PURE__ */ b(i, {
184
+ value: k,
185
+ onChange: (e) => A(e.target.value),
186
+ rows: 8,
187
+ className: "text-sm",
188
+ "aria-label": O("support.triage.draftTitle", "Reply draft"),
189
+ "data-testid": "support-triage-draft-text"
190
+ }),
191
+ w.draftCitations.length > 0 && /* @__PURE__ */ x("div", {
192
+ className: "mt-2",
193
+ children: [/* @__PURE__ */ b("p", {
194
+ className: "mb-1 text-xs text-text-secondary",
195
+ children: O("support.triage.sources", "Sources")
196
+ }), /* @__PURE__ */ b("ul", {
197
+ className: "flex flex-wrap gap-2",
198
+ "data-testid": "support-triage-citations",
199
+ children: w.draftCitations.map((e) => /* @__PURE__ */ b("li", { children: /* @__PURE__ */ b(t, {
200
+ variant: "outline",
201
+ children: e.kind === "FAQ" ? O("support.triage.citationFaq", "FAQ: {{title}}", { title: e.title }) : e.kind === "CANNED_RESPONSE" ? O("support.triage.citationCanned", "Canned: {{title}}", { title: e.title }) : O("support.triage.citationArticle", "Article: {{title}}", { title: e.title })
202
+ }) }, `${e.kind}:${e.id}`))
203
+ })]
204
+ }),
205
+ /* @__PURE__ */ x("div", {
206
+ className: "mt-3 flex flex-wrap justify-end gap-2",
207
+ children: [/* @__PURE__ */ x(n, {
208
+ variant: "ghost",
209
+ size: "sm",
210
+ onClick: () => void G(),
211
+ disabled: z,
212
+ "data-testid": "support-triage-discard",
213
+ children: [/* @__PURE__ */ b(_, { size: 14 }), O("support.triage.discard", "Discard")]
214
+ }), /* @__PURE__ */ x(n, {
215
+ size: "sm",
216
+ onClick: () => void W(),
217
+ disabled: z || k.trim().length === 0,
218
+ "data-testid": "support-triage-send",
219
+ children: [/* @__PURE__ */ b(h, { size: 14 }), O("support.triage.send", "Send to customer")]
220
+ })]
221
+ })
222
+ ]
223
+ })
224
+ ]
225
+ });
226
+ };
227
+ //#endregion
228
+ export { C as TriagePanel };
229
+
230
+ //# sourceMappingURL=TriagePanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TriagePanel.js","names":[],"sources":["../../../../src/support/components/tickets/TriagePanel.tsx"],"sourcesContent":["import { useEffect, useState, type FC } from 'react';\nimport { FileText, Sparkles, Send, Trash2, UserCheck } from 'lucide-react';\nimport { Badge, Button, EmphasisPanel, Textarea } from '../ui';\nimport {\n useGlobalDiscardTicketReplyDraftMutation,\n useGlobalDraftTicketReplyMutation,\n useGlobalSendTicketReplyDraftMutation,\n useGlobalTriageTicketMutation,\n type ReplyDraftFieldsFragment,\n type TriageDecisionFieldsFragment,\n} from '../../../generated/global-operations';\nimport { useTr } from '../../hooks/useTr';\nimport { extractErrorCode, extractErrorMessage } from '../../utils/errors';\n\n/** The first GraphQL error code, from either Apollo error shape (`errors` or `graphQLErrors`). */\nfunction graphQLErrorCode(error: unknown): string | null {\n const errors = (error as { errors?: Array<{ extensions?: { code?: unknown } }> } | null)?.errors;\n const code = errors?.[0]?.extensions?.code;\n return typeof code === 'string' ? code : extractErrorCode(error);\n}\nimport { ticketPriorityBadgeClasses } from '../../utils/uiTokens';\n\ninterface TriagePanelProps {\n ticketId: string;\n decision: TriageDecisionFieldsFragment | null | undefined;\n draft: ReplyDraftFieldsFragment | null | undefined;\n /** Category id → display name, for the decision summary. */\n categoryNames: Record<string, string>;\n /** Called after any change so the page can refetch the ticket. */\n onChanged: () => Promise<unknown> | void;\n notify: (type: 'success' | 'error' | 'info', message: string, durationMs?: number) => void;\n}\n\n/**\n * Agent-only panel for the support triage engine (BOFF-3646).\n *\n * Shows what triage decided and why (evidence, signals, notes), lets the agent\n * re-run it, and handles the KB-grounded reply draft: draft, edit, send, or\n * discard. A draft is never sent without the agent pressing Send.\n */\nexport const TriagePanel: FC<TriagePanelProps> = ({\n ticketId,\n decision,\n draft,\n categoryNames,\n onChanged,\n notify,\n}) => {\n const tr = useTr();\n const [draftText, setDraftText] = useState(draft?.message ?? '');\n const [triageTicket, { loading: triageLoading }] = useGlobalTriageTicketMutation();\n const [draftReply, { loading: draftLoading }] = useGlobalDraftTicketReplyMutation();\n const [sendDraft, { loading: sendLoading }] = useGlobalSendTicketReplyDraftMutation();\n const [discardDraft, { loading: discardLoading }] = useGlobalDiscardTicketReplyDraftMutation();\n const busy = triageLoading || draftLoading || sendLoading || discardLoading;\n\n // A new draft (or none) replaces whatever the agent was editing.\n useEffect(() => {\n setDraftText(draft?.message ?? '');\n }, [draft?.id, draft?.message]);\n\n const categoryLabel = (id: string | null | undefined): string =>\n id ? (categoryNames[id] ?? id) : tr('support.triage.noCategory', 'No category');\n\n /**\n * Apollo resolves (rather than rejects) a mutation whose response carries\n * GraphQL errors, handing them back on `result.error`. Treat both shapes as\n * a failure so a refused draft never shows a success toast.\n */\n const run = async (\n action: () => Promise<{ error?: unknown }>,\n success: string,\n failure: string\n ) => {\n try {\n const result = await action();\n if (result.error) throw result.error;\n await onChanged();\n notify('success', success);\n } catch (error) {\n if (graphQLErrorCode(error) === 'GROUNDING_INSUFFICIENT') {\n notify(\n 'info',\n tr(\n 'support.triage.errors.noGrounding',\n 'No published article or FAQ covers this ticket closely enough to draft a reply. Write this one by hand.'\n ),\n 8000\n );\n return;\n }\n notify('error', extractErrorMessage(error, failure), 6000);\n }\n };\n\n const handleTriage = () =>\n run(\n () => triageTicket({ variables: { id: ticketId } }),\n tr('support.triage.triaged', 'Ticket triaged.'),\n tr('support.triage.errors.triage', 'Triage failed.')\n );\n\n const handleDraft = () =>\n run(\n () => draftReply({ variables: { ticketId } }),\n tr('support.triage.drafted', 'Reply drafted from the knowledge base.'),\n tr('support.triage.errors.draft', 'Could not draft a reply.')\n );\n\n const handleSend = () => {\n if (!draft) return;\n const edited = draftText.trim() === draft.message.trim() ? undefined : draftText;\n return run(\n () => sendDraft({ variables: { id: draft.id, message: edited } }),\n tr('support.triage.sent', 'Reply sent to the customer.'),\n tr('support.triage.errors.send', 'Could not send the reply.')\n );\n };\n\n const handleDiscard = () => {\n if (!draft) return;\n return run(\n () => discardDraft({ variables: { id: draft.id } }),\n tr('support.triage.discarded', 'Draft discarded.'),\n tr('support.triage.errors.discard', 'Could not discard the draft.')\n );\n };\n\n const confidencePct = decision ? Math.round(decision.categoryConfidence * 100) : 0;\n\n return (\n <EmphasisPanel className=\"mb-6 p-4\" data-testid=\"support-triage-panel\">\n <div className=\"mb-3 flex flex-wrap items-center justify-between gap-2\">\n <h2 className=\"flex items-center gap-2 text-lg font-semibold text-text-primary\">\n <Sparkles size={18} className=\"text-primary\" />\n {tr('support.triage.title', 'Triage and reply draft')}\n </h2>\n <div className=\"flex flex-wrap gap-2\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => void handleTriage()}\n disabled={busy}\n data-testid=\"support-triage-run\"\n >\n <Sparkles size={14} />\n {decision\n ? tr('support.triage.rerun', 'Re-run triage')\n : tr('support.triage.run', 'Run triage')}\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => void handleDraft()}\n disabled={busy}\n data-testid=\"support-triage-draft\"\n >\n <FileText size={14} />\n {draft\n ? tr('support.triage.redraft', 'Draft again')\n : tr('support.triage.draft', 'Draft reply')}\n </Button>\n </div>\n </div>\n\n {decision ? (\n <div className=\"space-y-3 text-sm\" data-testid=\"support-triage-decision\">\n <div className=\"grid gap-3 sm:grid-cols-3\">\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('support.triage.category', 'Category')}\n </p>\n <div className=\"font-medium text-text-primary\">\n {categoryLabel(decision.categoryId)}\n {decision.categoryApplied && (\n <Badge variant=\"outline\" className=\"ml-2\">\n {tr('support.triage.setByTriage', 'set by triage')}\n </Badge>\n )}\n </div>\n {decision.proposedCategoryId && (\n <p className=\"text-xs text-text-secondary\">\n {tr('support.triage.confidence', '{{pct}}% of the evidence', {\n pct: confidencePct,\n })}\n </p>\n )}\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('support.triage.priority', 'Priority')}\n </p>\n <p className=\"flex flex-wrap items-center gap-1 font-medium text-text-primary\">\n {decision.previousPriority !== decision.priority && (\n <>\n <span className=\"text-text-secondary line-through\">\n {decision.previousPriority}\n </span>\n <span className=\"text-text-secondary\">→</span>\n </>\n )}\n <span\n className={`rounded border px-2 py-0.5 text-xs ${ticketPriorityBadgeClasses[decision.priority]}`}\n >\n {decision.priority}\n </span>\n </p>\n {decision.prioritySignals.length > 0 && (\n <p className=\"text-xs text-text-secondary\">{decision.prioritySignals.join(', ')}</p>\n )}\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('support.triage.suggestedAgent', 'Suggested agent')}\n </p>\n {decision.suggestedAssignee ? (\n <p className=\"flex items-center gap-1 font-medium text-text-primary\">\n <UserCheck size={14} className=\"text-primary\" />\n <span className=\"font-mono text-xs\">\n {decision.suggestedAssignee.userId.slice(0, 12)}\n </span>\n <span className=\"text-xs text-text-secondary\">\n {decision.suggestedAssignee.matchedSkills.length > 0\n ? decision.suggestedAssignee.matchedSkills.join(', ')\n : tr('support.triage.lightestLoad', 'lightest load')}\n </span>\n </p>\n ) : (\n <p className=\"text-text-secondary\">{tr('support.triage.none', 'None')}</p>\n )}\n </div>\n </div>\n\n {decision.evidence.length > 0 && (\n <div>\n <p className=\"mb-1 text-xs text-text-secondary\">\n {tr('support.triage.evidence', 'Based on')}\n </p>\n <ul className=\"flex flex-wrap gap-2\" data-testid=\"support-triage-evidence\">\n {decision.evidence.map((item) => (\n <li key={`${item.kind}:${item.id}`}>\n <Badge variant=\"secondary\">\n {item.kind === 'TICKET'\n ? tr('support.triage.evidenceTicket', 'Ticket {{label}}', {\n label: item.label,\n })\n : tr('support.triage.evidenceArticle', 'Article: {{label}}', {\n label: item.label,\n })}\n </Badge>\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {decision.notes.length > 0 && (\n <ul className=\"list-disc space-y-0.5 pl-5 text-xs text-text-secondary\">\n {decision.notes.map((note) => (\n <li key={note}>{note}</li>\n ))}\n </ul>\n )}\n\n <p className=\"text-xs text-text-secondary\">\n {decision.trigger === 'TICKET_CREATED'\n ? tr(\n 'support.triage.autoRun',\n 'Triaged automatically when the ticket arrived, {{at}}.',\n {\n at: new Date(decision.decidedAt).toLocaleString(),\n }\n )\n : tr('support.triage.manualRun', 'Triaged on request, {{at}}.', {\n at: new Date(decision.decidedAt).toLocaleString(),\n })}\n </p>\n </div>\n ) : (\n <p className=\"text-sm text-text-secondary\">\n {tr(\n 'support.triage.notTriaged',\n 'This ticket has not been triaged yet. Run triage to fill its category, priority and SLA from similar resolved tickets.'\n )}\n </p>\n )}\n\n {draft && (\n <div\n className=\"mt-4 rounded-lg border border-border-subtle bg-bg-surface p-3\"\n data-testid=\"support-triage-reply-draft\"\n >\n <div className=\"mb-2 flex items-center justify-between gap-2\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {tr('support.triage.draftTitle', 'Reply draft')}\n </h3>\n <span className=\"text-xs text-text-secondary\">\n {tr('support.triage.draftNotSent', 'Not sent — only you can see this.')}\n </span>\n </div>\n <Textarea\n value={draftText}\n onChange={(event) => setDraftText(event.target.value)}\n rows={8}\n className=\"text-sm\"\n aria-label={tr('support.triage.draftTitle', 'Reply draft')}\n data-testid=\"support-triage-draft-text\"\n />\n {draft.draftCitations.length > 0 && (\n <div className=\"mt-2\">\n <p className=\"mb-1 text-xs text-text-secondary\">\n {tr('support.triage.sources', 'Sources')}\n </p>\n <ul className=\"flex flex-wrap gap-2\" data-testid=\"support-triage-citations\">\n {draft.draftCitations.map((citation) => (\n <li key={`${citation.kind}:${citation.id}`}>\n <Badge variant=\"outline\">\n {citation.kind === 'FAQ'\n ? tr('support.triage.citationFaq', 'FAQ: {{title}}', {\n title: citation.title,\n })\n : citation.kind === 'CANNED_RESPONSE'\n ? tr('support.triage.citationCanned', 'Canned: {{title}}', {\n title: citation.title,\n })\n : tr('support.triage.citationArticle', 'Article: {{title}}', {\n title: citation.title,\n })}\n </Badge>\n </li>\n ))}\n </ul>\n </div>\n )}\n <div className=\"mt-3 flex flex-wrap justify-end gap-2\">\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => void handleDiscard()}\n disabled={busy}\n data-testid=\"support-triage-discard\"\n >\n <Trash2 size={14} />\n {tr('support.triage.discard', 'Discard')}\n </Button>\n <Button\n size=\"sm\"\n onClick={() => void handleSend()}\n disabled={busy || draftText.trim().length === 0}\n data-testid=\"support-triage-send\"\n >\n <Send size={14} />\n {tr('support.triage.send', 'Send to customer')}\n </Button>\n </div>\n </div>\n )}\n </EmphasisPanel>\n );\n};\n"],"mappings":";;;;;;;;;AAeA,SAAS,EAAiB,GAA+B;CAEvD,IAAM,KADU,GAA0E,OAAA,GACpE,EAAE,EAAE,YAAY;CACtC,OAAO,OAAO,KAAS,WAAW,IAAO,EAAiB,CAAK;AACjE;AAqBA,IAAa,KAAqC,EAChD,aACA,aACA,UACA,kBACA,cACA,gBACI;CACJ,IAAM,IAAK,EAAM,GACX,CAAC,GAAW,KAAgB,EAAS,GAAO,WAAW,EAAE,GACzD,CAAC,GAAc,EAAE,SAAS,OAAmB,EAA8B,GAC3E,CAAC,GAAY,EAAE,SAAS,OAAkB,EAAkC,GAC5E,CAAC,GAAW,EAAE,SAAS,OAAiB,EAAsC,GAC9E,CAAC,GAAc,EAAE,SAAS,OAAoB,EAAyC,GACvF,IAAO,KAAiB,KAAgB,KAAe;CAG7D,QAAgB;EACd,EAAa,GAAO,WAAW,EAAE;CACnC,GAAG,CAAC,GAAO,IAAI,GAAO,OAAO,CAAC;CAE9B,IAAM,KAAiB,MACrB,IAAM,EAAc,MAAO,IAAM,EAAG,6BAA6B,aAAa,GAO1E,IAAM,OACV,GACA,GACA,MACG;EACH,IAAI;GACF,IAAM,IAAS,MAAM,EAAO;GAC5B,IAAI,EAAO,OAAO,MAAM,EAAO;GAE/B,AADA,MAAM,EAAU,GAChB,EAAO,WAAW,CAAO;EAC3B,SAAS,GAAO;GACd,IAAI,EAAiB,CAAK,MAAM,0BAA0B;IACxD,EACE,QACA,EACE,qCACA,yGACF,GACA,GACF;IACA;GACF;GACA,EAAO,SAAS,EAAoB,GAAO,CAAO,GAAG,GAAI;EAC3D;CACF,GAEM,UACJ,QACQ,EAAa,EAAE,WAAW,EAAE,IAAI,EAAS,EAAE,CAAC,GAClD,EAAG,0BAA0B,iBAAiB,GAC9C,EAAG,gC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