@burdenoff/microfe-botmanor 2026.1120.27 → 2026.1123.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.
Files changed (35) hide show
  1. package/dist/botlit/components/HandoffConfigPanel.js +133 -132
  2. package/dist/botlit/components/HandoffConfigPanel.js.map +1 -1
  3. package/dist/botlit/components/HandoffTargetPickers.d.ts +28 -0
  4. package/dist/botlit/components/HandoffTargetPickers.js +180 -0
  5. package/dist/botlit/components/HandoffTargetPickers.js.map +1 -0
  6. package/dist/botlit/hooks/index.js +2 -2
  7. package/dist/botlit/hooks/useHandoffInbox.d.ts +26 -0
  8. package/dist/botlit/hooks/useHandoffInbox.js +126 -0
  9. package/dist/botlit/hooks/useHandoffInbox.js.map +1 -0
  10. package/dist/botlit/hooks/useHandoffs.js +36 -63
  11. package/dist/botlit/hooks/useHandoffs.js.map +1 -1
  12. package/dist/botlit/hooks/useMyIntegrationConnections.d.ts +4 -0
  13. package/dist/botlit/hooks/useMyIntegrationConnections.js +26 -0
  14. package/dist/botlit/hooks/useMyIntegrationConnections.js.map +1 -0
  15. package/dist/botlit/hooks/useWorkspaceMemberDirectory.d.ts +26 -0
  16. package/dist/botlit/hooks/useWorkspaceMemberDirectory.js +84 -0
  17. package/dist/botlit/hooks/useWorkspaceMemberDirectory.js.map +1 -0
  18. package/dist/botlit/pages/AiOperationsPage.js +100 -95
  19. package/dist/botlit/pages/AiOperationsPage.js.map +1 -1
  20. package/dist/botlit/pages/BotChannelsTab.js +288 -250
  21. package/dist/botlit/pages/BotChannelsTab.js.map +1 -1
  22. package/dist/botlit/pages/HandoffsPage.js +216 -171
  23. package/dist/botlit/pages/HandoffsPage.js.map +1 -1
  24. package/dist/botlit/permissions/botmanorPermissions.d.ts +1 -0
  25. package/dist/botlit/permissions/botmanorPermissions.js +1 -0
  26. package/dist/botlit/permissions/botmanorPermissions.js.map +1 -1
  27. package/dist/botlit/utils/handoffInbox.d.ts +64 -0
  28. package/dist/botlit/utils/handoffInbox.js +62 -0
  29. package/dist/botlit/utils/handoffInbox.js.map +1 -0
  30. package/dist/generated/wspace-operations.d.ts +160 -0
  31. package/dist/generated/wspace-operations.js +128 -87
  32. package/dist/generated/wspace-operations.js.map +1 -1
  33. package/dist/generated/wspace-types.js +8 -6
  34. package/dist/generated/wspace-types.js.map +1 -1
  35. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"HandoffsPage.js","names":["_Fragment","Fragment$1","HANDOFF_QUERY_PARAM","FILTERS","BotmanorHandoffStatus","TriggerBadge","t","useTr","labels","Badge","handoff","StatusBadge","entry","status","TRANSCRIPT_REFRESH_MS","minutesUntil","iso","now","SlaBadge","setNow","useState","open","isActiveHandoff","useEffect","timer","minutes","ROLE_LABEL_KEYS","BotmanorHandoffMessageRole","HandoffThread","messages","handoffId","role","message","formatRelativeTime","HandoffRow","accept","acceptState","useAcceptHandoff","release","releaseState","useReleaseHandoff","resolve","resolveState","useResolveHandoff","reject","rejectState","useRejectHandoff","assign","assignState","useAssignHandoff","reply","replyState","useReplyToHandoff","active","accepted","threadChoice","setThreadChoice","showThread","linked","rowRef","useRef","thread","useHandoffTranscript","refetchThread","draft","setDraft","assignee","setAssignee","busy","transitionError","sendReply","onChanged","assignTo","assigneeId","run","action","agents","Button","event","Textarea","Input","LinkedHandoffNotice","linkedId","items","filter","useDeepLinkFilter","choice","setChoice","fallback","next","HandoffsPage","searchParams","useSearchParams","setFilter","queue","useHandoffQueue","useAgents","agentNames","useMemo","agent","PageLayout","ErrorState","Card","CardHeader","CardTitle","CardDescription","CardContent","EmptyState"],"sources":["../../../src/botlit/pages/HandoffsPage.tsx"],"sourcesContent":["/**\n * Handoffs Page (BOFF-5813)\n * @module botlit/pages\n *\n * The shared team inbox: every handoff of a live conversation from an agent\n * to a human operator. Operators take a conversation over (the bot stops\n * replying), read its thread and reply to the customer in the same channel\n * thread, assign it to a teammate, hand it back to the bot, resolve it, or\n * reject it. Each handoff shows its first-reply SLA (BOFF-15360). Filters\n * narrow the queue by status and agent.\n *\n * Handoff notifications deep-link here as `?handoff=<id>` (BOFF-15421): the\n * linked handoff is highlighted, its conversation opened and scrolled into\n * view, so the operator lands on the conversation that needs them.\n */\nimport type { FC, FormEvent } from 'react';\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { useSearchParams } from 'react-router';\nimport { useTr } from '../../shared/hooks/useTr';\nimport { PageLayout } from '../components/PageLayout';\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from '../components/Card';\nimport { Button } from '../components/Button';\nimport { Badge } from '../components/Badge';\nimport { EmptyState } from '../components/EmptyState';\nimport { ErrorState } from '../components/ErrorState';\nimport { Input, Textarea } from '../components/Input';\nimport {\n useAssignHandoff,\n useHandoffTranscript,\n useReplyToHandoff,\n type HandoffMessageRecord,\n useAgents,\n useHandoffQueue,\n useAcceptHandoff,\n useReleaseHandoff,\n useResolveHandoff,\n useRejectHandoff,\n isActiveHandoff,\n type HandoffRecord,\n} from '../hooks';\nimport { BotmanorHandoffMessageRole, BotmanorHandoffStatus } from '../../generated/wspace-types';\nimport { formatRelativeTime } from '../utils/formatters';\n\ntype QueueFilter = 'active' | 'resolved' | 'all';\n\n/**\n * Search parameter a handoff notification links with. Mirrors\n * `HANDOFF_QUERY_PARAM` in wspace-botmanor-svc `src/config/app-routes.ts`.\n */\nexport const HANDOFF_QUERY_PARAM = 'handoff';\n\nconst FILTERS: Array<{\n id: QueueFilter;\n statuses: BotmanorHandoffStatus[] | null;\n labelKey: string;\n label: string;\n}> = [\n {\n id: 'active',\n statuses: [\n BotmanorHandoffStatus.Requested,\n BotmanorHandoffStatus.Assigned,\n BotmanorHandoffStatus.Accepted,\n ],\n labelKey: 'botlit.handoffs.filter.active',\n label: 'Active',\n },\n {\n id: 'resolved',\n statuses: [\n BotmanorHandoffStatus.Resolved,\n BotmanorHandoffStatus.Released,\n BotmanorHandoffStatus.Rejected,\n ],\n labelKey: 'botlit.handoffs.filter.resolved',\n label: 'Closed',\n },\n { id: 'all', statuses: null, labelKey: 'botlit.handoffs.filter.all', label: 'All' },\n];\n\nconst TriggerBadge: FC<{ handoff: HandoffRecord }> = ({ handoff }) => {\n const t = useTr();\n const labels: Record<string, string> = {\n EXPLICIT_REQUEST: t('botlit.handoffs.trigger.explicitRequest', 'Explicit request'),\n CUSTOM_INTENT: t('botlit.handoffs.trigger.customIntent', 'Custom intent'),\n LOW_CONFIDENCE: t('botlit.handoffs.trigger.lowConfidence', 'Low confidence'),\n REPEATED_FAILURES: t('botlit.handoffs.trigger.repeatedFailures', 'Repeated failures'),\n POLICY_REFUSAL: t('botlit.handoffs.trigger.policyRefusal', 'Policy refusal'),\n MANUAL: t('botlit.handoffs.trigger.manual', 'Manual'),\n };\n return <Badge variant=\"outline\">{labels[handoff.trigger] ?? handoff.trigger}</Badge>;\n};\n\nconst StatusBadge: FC<{ status: BotmanorHandoffStatus }> = ({ status }) => {\n const t = useTr();\n const labels: Record<\n BotmanorHandoffStatus,\n { text: string; variant: 'success' | 'warning' | 'outline' | 'destructive' }\n > = {\n [BotmanorHandoffStatus.Requested]: {\n text: t('botlit.handoffs.status.requested', 'Requested'),\n variant: 'warning',\n },\n [BotmanorHandoffStatus.Assigned]: {\n text: t('botlit.handoffs.status.assigned', 'Assigned'),\n variant: 'warning',\n },\n [BotmanorHandoffStatus.Accepted]: {\n text: t('botlit.handoffs.status.accepted', 'Accepted'),\n variant: 'success',\n },\n [BotmanorHandoffStatus.Resolved]: {\n text: t('botlit.handoffs.status.resolved', 'Resolved'),\n variant: 'outline',\n },\n [BotmanorHandoffStatus.Released]: {\n text: t('botlit.handoffs.status.released', 'Released to bot'),\n variant: 'outline',\n },\n [BotmanorHandoffStatus.Rejected]: {\n text: t('botlit.handoffs.status.rejected', 'Rejected'),\n variant: 'destructive',\n },\n [BotmanorHandoffStatus.Expired]: {\n text: t('botlit.handoffs.status.expired', 'Expired'),\n variant: 'outline',\n },\n };\n // Unknown enum values (a newer server variant) must not crash the page.\n const entry = labels[status] ?? { text: String(status), variant: 'outline' as const };\n return <Badge variant={entry.variant}>{entry.text}</Badge>;\n};\n\n/** How often an open handoff thread re-reads new messages. */\nconst TRANSCRIPT_REFRESH_MS = 10_000;\n\n/** Minutes from now until `iso` (negative once past). */\nfunction minutesUntil(iso: string, now: number): number {\n return Math.round((new Date(iso).getTime() - now) / 60_000);\n}\n\n/** BOFF-15360 — the first-reply SLA: due, met, or breached. */\nconst SlaBadge: FC<{ handoff: HandoffRecord }> = ({ handoff }) => {\n const t = useTr();\n const [now, setNow] = useState(() => Date.now());\n const open = isActiveHandoff(handoff.status) && !handoff.firstResponseAt;\n useEffect(() => {\n if (!open) return undefined;\n const timer = window.setInterval(() => setNow(Date.now()), 30_000);\n return () => window.clearInterval(timer);\n }, [open]);\n\n if (!handoff.slaDueAt) return null;\n // The server's flag is as of the last fetch; the ticking clock catches a\n // deadline that passes while the page is open.\n const breached = handoff.slaBreached || (open && new Date(handoff.slaDueAt).getTime() <= now);\n if (breached) {\n return (\n <Badge variant=\"destructive\" data-testid=\"handoff-sla\">\n {t('botlit.handoffs.sla.breached', 'SLA breached')}\n </Badge>\n );\n }\n if (handoff.firstResponseAt) {\n return (\n <Badge variant=\"success\" data-testid=\"handoff-sla\">\n {t('botlit.handoffs.sla.met', 'SLA met')}\n </Badge>\n );\n }\n if (!open) return null;\n const minutes = Math.max(minutesUntil(handoff.slaDueAt, now), 0);\n return (\n <Badge variant=\"warning\" data-testid=\"handoff-sla\">\n {t('botlit.handoffs.sla.due', 'Reply due in {{minutes}} min', { minutes })}\n </Badge>\n );\n};\n\nconst ROLE_LABEL_KEYS: Record<BotmanorHandoffMessageRole, { key: string; label: string }> = {\n [BotmanorHandoffMessageRole.Customer]: {\n key: 'botlit.handoffs.thread.customer',\n label: 'Customer',\n },\n [BotmanorHandoffMessageRole.Bot]: { key: 'botlit.handoffs.thread.bot', label: 'Bot' },\n [BotmanorHandoffMessageRole.Operator]: {\n key: 'botlit.handoffs.thread.operator',\n label: 'Operator',\n },\n};\n\n/** BOFF-15360 — the handoff thread, oldest first. */\nconst HandoffThread: FC<{ handoffId: string; messages: HandoffMessageRecord[] }> = ({\n handoffId,\n messages,\n}) => {\n const t = useTr();\n if (messages.length === 0) {\n return (\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.handoffs.thread.empty', 'No messages on this handoff yet.')}\n </p>\n );\n }\n return (\n <ol\n className=\"grid gap-2 rounded-card border border-border-seam p-3\"\n aria-label={t('botlit.handoffs.thread.label', 'Conversation')}\n data-testid={`handoff-thread-${handoffId}`}\n >\n {messages.map((message) => {\n const role = ROLE_LABEL_KEYS[message.role] ?? { key: '', label: String(message.role) };\n return (\n <li key={message.id} className=\"grid gap-0.5\">\n <span className=\"text-xs font-medium text-text-secondary\">\n {role.key ? t(role.key, role.label) : role.label} ·{' '}\n {formatRelativeTime(message.createdAt)}\n </span>\n <span className=\"text-sm whitespace-pre-wrap text-text-primary\">{message.text}</span>\n </li>\n );\n })}\n </ol>\n );\n};\n\nconst HandoffRow: FC<{\n handoff: HandoffRecord;\n agents: Map<string, string>;\n onChanged: () => void;\n /** True when a notification deep-linked to this handoff. */\n linked?: boolean;\n}> = ({ handoff, agents, onChanged, linked = false }) => {\n const t = useTr();\n const [accept, acceptState] = useAcceptHandoff();\n const [release, releaseState] = useReleaseHandoff();\n const [resolve, resolveState] = useResolveHandoff();\n const [reject, rejectState] = useRejectHandoff();\n const [assign, assignState] = useAssignHandoff();\n const [reply, replyState] = useReplyToHandoff();\n const active = isActiveHandoff(handoff.status);\n const accepted = handoff.status === BotmanorHandoffStatus.Accepted;\n // Collapsed until the operator opens it: a long queue must not load every\n // thread. A deep-linked row starts open; the operator's own toggle wins\n // until the link changes (derived in render, no state sync effect).\n const [threadChoice, setThreadChoice] = useState<{ linked: boolean; open: boolean } | null>(null);\n const showThread = threadChoice && threadChoice.linked === linked ? threadChoice.open : linked;\n const rowRef = useRef<HTMLLIElement>(null);\n // Bring the deep-linked handoff into view once it renders.\n useEffect(() => {\n if (linked) rowRef.current?.scrollIntoView?.({ block: 'center', behavior: 'smooth' });\n }, [linked]);\n const thread = useHandoffTranscript(showThread ? handoff.id : undefined);\n const refetchThread = thread.refetch;\n // New customer messages arrive while the thread is open and a human is needed.\n useEffect(() => {\n if (!showThread || !active) return undefined;\n const timer = window.setInterval(() => {\n void refetchThread();\n }, TRANSCRIPT_REFRESH_MS);\n return () => window.clearInterval(timer);\n }, [showThread, active, refetchThread]);\n const [draft, setDraft] = useState('');\n const [assignee, setAssignee] = useState('');\n const busy =\n acceptState.loading ||\n releaseState.loading ||\n resolveState.loading ||\n rejectState.loading ||\n assignState.loading ||\n replyState.loading;\n const transitionError =\n acceptState.error ??\n releaseState.error ??\n resolveState.error ??\n rejectState.error ??\n assignState.error ??\n replyState.error;\n\n const sendReply = async (event: FormEvent) => {\n event.preventDefault();\n const message = draft.trim();\n if (!message) return;\n try {\n await reply({ id: handoff.id, message });\n setDraft('');\n await thread.refetch();\n onChanged();\n } catch {\n /* the hook state already carries the message */\n }\n };\n\n const assignTo = async (event: FormEvent) => {\n event.preventDefault();\n const assigneeId = assignee.trim();\n if (!assigneeId) return;\n try {\n await assign({ id: handoff.id, assigneeId });\n setAssignee('');\n onChanged();\n } catch {\n /* the hook state already carries the message */\n }\n };\n\n const run = async (action: (id: string) => Promise<unknown>) => {\n try {\n await action(handoff.id);\n onChanged();\n } catch {\n /* the hook state already carries the message */\n }\n };\n\n return (\n <li\n ref={rowRef}\n data-testid={`handoff-row-${handoff.id}`}\n aria-current={linked ? 'true' : undefined}\n className={`grid gap-3 rounded-card border bg-bg-surface p-4 ${\n linked ? 'border-primary ring-2 ring-primary' : 'border-border-seam'\n }`}\n >\n <div className=\"flex flex-wrap items-center gap-2\">\n <StatusBadge status={handoff.status} />\n <TriggerBadge handoff={handoff} />\n <SlaBadge handoff={handoff} />\n {handoff.replyChannel ? <Badge variant=\"outline\">{handoff.replyChannel}</Badge> : null}\n <span className=\"text-xs text-text-secondary\">\n {t('botlit.handoffs.opened', 'Opened {{time}}', {\n time: formatRelativeTime(handoff.createdAt),\n })}\n </span>\n </div>\n <p className=\"text-sm text-text-primary\">{handoff.reason}</p>\n {handoff.userMessage ? (\n <blockquote className=\"border-l-2 border-border-seam pl-3 text-sm text-text-secondary italic\">\n {handoff.userMessage}\n </blockquote>\n ) : null}\n <div className=\"flex flex-wrap items-center gap-2 text-xs text-text-secondary\">\n <span>\n {agents.get(handoff.agentId)\n ? t('botlit.handoffs.agent', 'Agent {{name}}', {\n name: agents.get(handoff.agentId) as string,\n })\n : t('botlit.handoffs.conversation', 'Conversation {{key}}', {\n key: handoff.conversationKey,\n })}\n </span>\n {handoff.assignedToId ? (\n <span>\n {t('botlit.handoffs.assignedTo', '· with {{who}}', { who: handoff.assignedToId })}\n </span>\n ) : null}\n </div>\n <div>\n <Button\n size=\"sm\"\n variant=\"ghost\"\n aria-expanded={showThread}\n onClick={() => setThreadChoice({ linked, open: !showThread })}\n >\n {showThread\n ? t('botlit.handoffs.thread.hide', 'Hide conversation')\n : t('botlit.handoffs.thread.show', 'Show conversation')}\n </Button>\n </div>\n {showThread ? (\n thread.loading && thread.data.length === 0 ? (\n <p role=\"status\" className=\"text-sm text-text-secondary\">\n {t('botlit.handoffs.thread.loading', 'Loading conversation…')}\n </p>\n ) : thread.error ? (\n <p role=\"alert\" className=\"text-sm text-status-danger-text\">\n {thread.error.message}\n </p>\n ) : (\n <HandoffThread handoffId={handoff.id} messages={thread.data} />\n )\n ) : null}\n {accepted && handoff.replyChannel ? (\n <form className=\"grid gap-2\" onSubmit={(event) => void sendReply(event)}>\n <label className=\"text-sm font-medium text-text-primary\" htmlFor={`reply-${handoff.id}`}>\n {t('botlit.handoffs.reply.label', 'Reply to the customer')}\n </label>\n <Textarea\n id={`reply-${handoff.id}`}\n value={draft}\n maxLength={4000}\n rows={3}\n onChange={(event) => setDraft(event.target.value)}\n placeholder={t(\n 'botlit.handoffs.reply.placeholder',\n 'Sent in the same thread as the bot — the bot stays quiet until you hand back.'\n )}\n />\n <div>\n <Button size=\"sm\" type=\"submit\" disabled={busy || !draft.trim()}>\n {t('botlit.handoffs.reply.send', 'Send reply')}\n </Button>\n </div>\n </form>\n ) : null}\n {accepted && !handoff.replyChannel ? (\n <p className=\"text-sm text-text-secondary\">\n {t(\n 'botlit.handoffs.reply.webChat',\n 'This conversation came from web chat, which has no channel to reply on.'\n )}\n </p>\n ) : null}\n {active ? (\n <form\n className=\"flex flex-wrap items-center gap-2\"\n onSubmit={(event) => void assignTo(event)}\n >\n <label className=\"sr-only\" htmlFor={`assign-${handoff.id}`}>\n {t('botlit.handoffs.assign.label', 'Assign to (user id)')}\n </label>\n <Input\n id={`assign-${handoff.id}`}\n className=\"max-w-xs\"\n value={assignee}\n onChange={(event) => setAssignee(event.target.value)}\n placeholder={t('botlit.handoffs.assign.placeholder', 'Teammate user id')}\n />\n <Button size=\"sm\" variant=\"outline\" type=\"submit\" disabled={busy || !assignee.trim()}>\n {t('botlit.handoffs.assign.submit', 'Assign')}\n </Button>\n </form>\n ) : null}\n {transitionError ? (\n <p role=\"alert\" className=\"text-sm text-status-danger-text\">\n {transitionError.message}\n </p>\n ) : null}\n <div className=\"flex flex-wrap gap-2\">\n {handoff.status === BotmanorHandoffStatus.Requested ||\n handoff.status === BotmanorHandoffStatus.Assigned ? (\n <>\n <Button size=\"sm\" disabled={busy} onClick={() => void run(accept)}>\n {t('botlit.handoffs.actions.takeOver', 'Take over')}\n </Button>\n <Button size=\"sm\" variant=\"outline\" disabled={busy} onClick={() => void run(reject)}>\n {t('botlit.handoffs.actions.reject', 'Reject')}\n </Button>\n </>\n ) : null}\n {handoff.status === BotmanorHandoffStatus.Accepted ? (\n <>\n <Button size=\"sm\" variant=\"outline\" disabled={busy} onClick={() => void run(release)}>\n {t('botlit.handoffs.actions.handBack', 'Hand back to bot')}\n </Button>\n <Button size=\"sm\" disabled={busy} onClick={() => void run(resolve)}>\n {t('botlit.handoffs.actions.resolve', 'Resolve')}\n </Button>\n </>\n ) : null}\n </div>\n </li>\n );\n};\n\n/**\n * Says when the handoff a notification links to is not in the list.\n * `items` is null while the queue is loading or failed.\n */\nconst LinkedHandoffNotice: FC<{\n linkedId: string | null;\n filter: QueueFilter;\n items: ReadonlyArray<{ id: string }> | null;\n}> = ({ linkedId, filter, items }) => {\n const t = useTr();\n if (!linkedId || !items || items.some((handoff) => handoff.id === linkedId)) return null;\n return (\n <p role=\"status\" className=\"text-sm text-text-secondary\" data-testid=\"handoff-link-missing\">\n {filter === 'all'\n ? t(\n 'botlit.handoffs.linkMissing',\n 'The handoff from your notification could not be found. It may have been removed.'\n )\n : t(\n 'botlit.handoffs.linkMissingFiltered',\n 'The handoff from your notification is not in this list. Switch to All to see every status.'\n )}\n </p>\n );\n};\n\n/**\n * The queue filter. A linked handoff may already be closed, so each new link\n * opens on every status; the operator's own pick wins until the link changes,\n * also when a second notification is opened on this page (derived in render).\n */\nfunction useDeepLinkFilter(linkedId: string | null): [QueueFilter, (next: QueueFilter) => void] {\n const [choice, setChoice] = useState<{ linkedId: string | null; filter: QueueFilter } | null>(\n null\n );\n const fallback: QueueFilter = linkedId ? 'all' : 'active';\n const filter = choice && choice.linkedId === linkedId ? choice.filter : fallback;\n return [filter, (next) => setChoice({ linkedId, filter: next })];\n}\n\nexport const HandoffsPage: FC = () => {\n const t = useTr();\n const [searchParams] = useSearchParams();\n const linkedId = searchParams.get(HANDOFF_QUERY_PARAM)?.trim() || null;\n const [filter, setFilter] = useDeepLinkFilter(linkedId);\n const active = FILTERS.find((entry) => entry.id === filter) ?? FILTERS[0];\n const queue = useHandoffQueue({ statuses: active.statuses ?? undefined });\n const agents = useAgents();\n const agentNames = useMemo(\n () => new Map((agents.data ?? []).map((agent) => [agent.id, agent.name])),\n [agents.data]\n );\n\n return (\n <PageLayout\n title={t('botlit.handoffs.title', 'Human Handoffs')}\n description={t(\n 'botlit.handoffs.description',\n 'Conversations the runtime handed to your team. Taking one over stops the bot from replying until you hand it back.'\n )}\n >\n <div className=\"mx-auto flex w-full max-w-4xl flex-col gap-4 p-4\">\n <div className=\"flex flex-wrap items-center gap-2\">\n {FILTERS.map((entry) => (\n <Button\n key={entry.id}\n size=\"sm\"\n variant={filter === entry.id ? 'primary' : 'outline'}\n onClick={() => setFilter(entry.id)}\n >\n {t(entry.labelKey, entry.label)}\n </Button>\n ))}\n <Button size=\"sm\" variant=\"outline\" onClick={() => void queue.refetch()}>\n {t('botlit.handoffs.refresh', 'Refresh')}\n </Button>\n </div>\n\n <LinkedHandoffNotice\n linkedId={linkedId}\n filter={filter}\n items={queue.loading || queue.error ? null : (queue.data?.items ?? null)}\n />\n\n {queue.loading ? (\n <p role=\"status\">{t('botlit.handoffs.loading', 'Loading handoffs…')}</p>\n ) : queue.error ? (\n <ErrorState\n resource={t('botlit.handoffs.errorResource', 'handoffs')}\n error={queue.error}\n onRetry={() => void queue.refetch()}\n />\n ) : queue.data && queue.data.items.length > 0 ? (\n <Card>\n <CardHeader>\n <CardTitle>{t('botlit.handoffs.queue', 'Team inbox')}</CardTitle>\n <CardDescription>\n {t(\n 'botlit.handoffs.queueDescription',\n 'Newest first — accept a conversation to take it over.'\n )}\n </CardDescription>\n </CardHeader>\n <CardContent>\n <ul className=\"grid gap-3\">\n {queue.data.items.map((handoff) => (\n <HandoffRow\n key={handoff.id}\n handoff={handoff}\n agents={agentNames}\n onChanged={() => void queue.refetch()}\n linked={handoff.id === linkedId}\n />\n ))}\n </ul>\n </CardContent>\n </Card>\n ) : (\n <EmptyState\n title={t('botlit.handoffs.empty', 'No handoffs')}\n description={t(\n 'botlit.handoffs.emptyDescription',\n 'Nothing needs a human right now. Triggered handoffs from your agents land here.'\n )}\n />\n )}\n {queue.data && queue.data.hasMore ? (\n <p className=\"text-sm text-text-secondary\">\n {t(\n 'botlit.handoffs.truncated',\n 'Showing the {{shown}} most recent of {{total}} handoffs — narrow the filter to see the rest.',\n { shown: queue.data.items.length, total: queue.data.total }\n )}\n </p>\n ) : null}\n </div>\n </PageLay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EAAM,QAAQ;MACpC,QAAQpF,EAAQ,OAAOwE;KACxB,GALMxE,EAAQ,EAKd,CACF;IACC,CAAA,EACO,CAAA,CACT,EAAA,CAAA,IAEN,kBAACiG,GAAD;KACE,OAAOrG,EAAE,yBAAyB,aAAa;KAC/C,aAAaA,EACX,oCACA,iFACF;IACD,CAAA;IAEFwF,EAAM,QAAQA,EAAM,KAAK,UACxB,kBAAC,KAAD;KAAG,WAAU;KACV,UAAAxF,EACC,6BACA,gGACA;MAAE,OAAOwF,EAAM,KAAK,MAAM;MAAQ,OAAOA,EAAM,KAAK;KAAM,CAC5D;IACC,CAAA,IACD;GACD;;CACK,CAAA;AAEhB"}
1
+ {"version":3,"file":"HandoffsPage.js","names":["_Fragment","Fragment$1","HANDOFF_QUERY_PARAM","FILTERS","BotmanorHandoffStatus","TriggerBadge","t","useTr","labels","Badge","handoff","StatusBadge","entry","status","TRANSCRIPT_REFRESH_MS","minutesUntil","iso","now","SlaBadge","setNow","useState","open","isActiveHandoff","useEffect","timer","minutes","ROLE_LABEL_KEYS","BotmanorHandoffMessageRole","HandoffThread","messages","handoffId","role","message","formatRelativeTime","HandoffRow","accept","acceptState","useAcceptHandoff","release","releaseState","useReleaseHandoff","resolve","resolveState","useResolveHandoff","reject","rejectState","useRejectHandoff","assign","assignState","useAssignHandoff","reply","replyState","useReplyToHandoff","active","accepted","threadChoice","setThreadChoice","showThread","linked","rowRef","useRef","thread","useHandoffTranscript","refetchThread","draft","setDraft","assignee","setAssignee","busy","transitionError","conflict","isHandoffConflict","memberName","members","member","userId","shortUserLabel","sendReply","onChanged","assignTo","assigneeId","run","action","error","isNew","agents","Button","canManage","event","Textarea","LinkedHandoffNotice","linkedId","items","filter","useDeepLinkFilter","choice","setChoice","fallback","next","HandoffsPage","useBotmanorPermission","BOTMANOR_PERMISSIONS","searchParams","useSearchParams","setFilter","queue","useHandoffInbox","directory","useWorkspaceMemberDirectory","useAgents","agentNames","useMemo","agent","PageLayout","ErrorState","Card","CardHeader","CardTitle","CardDescription","CardContent","EmptyState","LoadMore"],"sources":["../../../src/botlit/pages/HandoffsPage.tsx"],"sourcesContent":["/**\n * Handoffs Page (BOFF-5813)\n * @module botlit/pages\n *\n * The shared team inbox: every handoff of a live conversation from an agent\n * to a human operator. Operators take a conversation over (the bot stops\n * replying), read its thread and reply to the customer in the same channel\n * thread, assign it to a teammate, hand it back to the bot, resolve it, or\n * reject it. Each handoff shows its first-reply SLA (BOFF-15360). Filters\n * narrow the queue by status and agent.\n *\n * Handoff notifications deep-link here as `?handoff=<id>` (BOFF-15421): the\n * linked handoff is highlighted, its conversation opened and scrolled into\n * view, so the operator lands on the conversation that needs them.\n *\n * BOFF-15472: the inbox refreshes itself while visible and when the tab\n * regains focus, marks handoffs that arrived since, pages past 100 with\n * \"Load more\", assigns to a teammate picked by name, and explains a take-over\n * that a teammate won first.\n */\nimport type { FC, FormEvent } from 'react';\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { useSearchParams } from 'react-router';\nimport { useTr } from '../../shared/hooks/useTr';\nimport { PageLayout } from '../components/PageLayout';\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from '../components/Card';\nimport { Button } from '../components/Button';\nimport { Badge } from '../components/Badge';\nimport { EmptyState } from '../components/EmptyState';\nimport { ErrorState } from '../components/ErrorState';\nimport { Textarea } from '../components/Input';\nimport {\n useAssignHandoff,\n useHandoffTranscript,\n useReplyToHandoff,\n type HandoffMessageRecord,\n useAgents,\n useAcceptHandoff,\n useReleaseHandoff,\n useResolveHandoff,\n useRejectHandoff,\n isActiveHandoff,\n type HandoffRecord,\n} from '../hooks';\nimport { BotmanorHandoffMessageRole, BotmanorHandoffStatus } from '../../generated/wspace-types';\nimport { formatRelativeTime } from '../utils/formatters';\nimport { useHandoffInbox } from '../hooks/useHandoffInbox';\nimport {\n shortUserLabel,\n useWorkspaceMemberDirectory,\n type DirectoryMember,\n} from '../hooks/useWorkspaceMemberDirectory';\nimport { isHandoffConflict } from '../utils/handoffInbox';\nimport { LoadMore } from '../components/LoadMore';\nimport { BOTMANOR_PERMISSIONS, useBotmanorPermission } from '../permissions';\n\ntype QueueFilter = 'active' | 'resolved' | 'all';\n\n/**\n * Search parameter a handoff notification links with. Mirrors\n * `HANDOFF_QUERY_PARAM` in wspace-botmanor-svc `src/config/app-routes.ts`.\n */\nexport const HANDOFF_QUERY_PARAM = 'handoff';\n\nconst FILTERS: Array<{\n id: QueueFilter;\n statuses: BotmanorHandoffStatus[] | null;\n labelKey: string;\n label: string;\n}> = [\n {\n id: 'active',\n statuses: [\n BotmanorHandoffStatus.Requested,\n BotmanorHandoffStatus.Assigned,\n BotmanorHandoffStatus.Accepted,\n ],\n labelKey: 'botlit.handoffs.filter.active',\n label: 'Active',\n },\n {\n id: 'resolved',\n statuses: [\n BotmanorHandoffStatus.Resolved,\n BotmanorHandoffStatus.Released,\n BotmanorHandoffStatus.Rejected,\n ],\n labelKey: 'botlit.handoffs.filter.resolved',\n label: 'Closed',\n },\n { id: 'all', statuses: null, labelKey: 'botlit.handoffs.filter.all', label: 'All' },\n];\n\nconst TriggerBadge: FC<{ handoff: HandoffRecord }> = ({ handoff }) => {\n const t = useTr();\n const labels: Record<string, string> = {\n EXPLICIT_REQUEST: t('botlit.handoffs.trigger.explicitRequest', 'Explicit request'),\n CUSTOM_INTENT: t('botlit.handoffs.trigger.customIntent', 'Custom intent'),\n LOW_CONFIDENCE: t('botlit.handoffs.trigger.lowConfidence', 'Low confidence'),\n REPEATED_FAILURES: t('botlit.handoffs.trigger.repeatedFailures', 'Repeated failures'),\n POLICY_REFUSAL: t('botlit.handoffs.trigger.policyRefusal', 'Policy refusal'),\n MANUAL: t('botlit.handoffs.trigger.manual', 'Manual'),\n };\n return <Badge variant=\"outline\">{labels[handoff.trigger] ?? handoff.trigger}</Badge>;\n};\n\nconst StatusBadge: FC<{ status: BotmanorHandoffStatus }> = ({ status }) => {\n const t = useTr();\n const labels: Record<\n BotmanorHandoffStatus,\n { text: string; variant: 'success' | 'warning' | 'outline' | 'destructive' }\n > = {\n [BotmanorHandoffStatus.Requested]: {\n text: t('botlit.handoffs.status.requested', 'Requested'),\n variant: 'warning',\n },\n [BotmanorHandoffStatus.Assigned]: {\n text: t('botlit.handoffs.status.assigned', 'Assigned'),\n variant: 'warning',\n },\n [BotmanorHandoffStatus.Accepted]: {\n text: t('botlit.handoffs.status.accepted', 'Accepted'),\n variant: 'success',\n },\n [BotmanorHandoffStatus.Resolved]: {\n text: t('botlit.handoffs.status.resolved', 'Resolved'),\n variant: 'outline',\n },\n [BotmanorHandoffStatus.Released]: {\n text: t('botlit.handoffs.status.released', 'Released to bot'),\n variant: 'outline',\n },\n [BotmanorHandoffStatus.Rejected]: {\n text: t('botlit.handoffs.status.rejected', 'Rejected'),\n variant: 'destructive',\n },\n [BotmanorHandoffStatus.Expired]: {\n text: t('botlit.handoffs.status.expired', 'Expired'),\n variant: 'outline',\n },\n };\n // Unknown enum values (a newer server variant) must not crash the page.\n const entry = labels[status] ?? { text: String(status), variant: 'outline' as const };\n return <Badge variant={entry.variant}>{entry.text}</Badge>;\n};\n\n/** How often an open handoff thread re-reads new messages. */\nconst TRANSCRIPT_REFRESH_MS = 10_000;\n\n/** Minutes from now until `iso` (negative once past). */\nfunction minutesUntil(iso: string, now: number): number {\n return Math.round((new Date(iso).getTime() - now) / 60_000);\n}\n\n/** BOFF-15360 — the first-reply SLA: due, met, or breached. */\nconst SlaBadge: FC<{ handoff: HandoffRecord }> = ({ handoff }) => {\n const t = useTr();\n const [now, setNow] = useState(() => Date.now());\n const open = isActiveHandoff(handoff.status) && !handoff.firstResponseAt;\n useEffect(() => {\n if (!open) return undefined;\n const timer = window.setInterval(() => setNow(Date.now()), 30_000);\n return () => window.clearInterval(timer);\n }, [open]);\n\n if (!handoff.slaDueAt) return null;\n // The server's flag is as of the last fetch; the ticking clock catches a\n // deadline that passes while the page is open.\n const breached = handoff.slaBreached || (open && new Date(handoff.slaDueAt).getTime() <= now);\n if (breached) {\n return (\n <Badge variant=\"destructive\" data-testid=\"handoff-sla\">\n {t('botlit.handoffs.sla.breached', 'SLA breached')}\n </Badge>\n );\n }\n if (handoff.firstResponseAt) {\n return (\n <Badge variant=\"success\" data-testid=\"handoff-sla\">\n {t('botlit.handoffs.sla.met', 'SLA met')}\n </Badge>\n );\n }\n if (!open) return null;\n const minutes = Math.max(minutesUntil(handoff.slaDueAt, now), 0);\n return (\n <Badge variant=\"warning\" data-testid=\"handoff-sla\">\n {t('botlit.handoffs.sla.due', 'Reply due in {{minutes}} min', { minutes })}\n </Badge>\n );\n};\n\nconst ROLE_LABEL_KEYS: Record<BotmanorHandoffMessageRole, { key: string; label: string }> = {\n [BotmanorHandoffMessageRole.Customer]: {\n key: 'botlit.handoffs.thread.customer',\n label: 'Customer',\n },\n [BotmanorHandoffMessageRole.Bot]: { key: 'botlit.handoffs.thread.bot', label: 'Bot' },\n [BotmanorHandoffMessageRole.Operator]: {\n key: 'botlit.handoffs.thread.operator',\n label: 'Operator',\n },\n};\n\n/** BOFF-15360 — the handoff thread, oldest first. */\nconst HandoffThread: FC<{ handoffId: string; messages: HandoffMessageRecord[] }> = ({\n handoffId,\n messages,\n}) => {\n const t = useTr();\n if (messages.length === 0) {\n return (\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.handoffs.thread.empty', 'No messages on this handoff yet.')}\n </p>\n );\n }\n return (\n <ol\n className=\"grid gap-2 rounded-card border border-border-seam p-3\"\n aria-label={t('botlit.handoffs.thread.label', 'Conversation')}\n data-testid={`handoff-thread-${handoffId}`}\n >\n {messages.map((message) => {\n const role = ROLE_LABEL_KEYS[message.role] ?? { key: '', label: String(message.role) };\n return (\n <li key={message.id} className=\"grid gap-0.5\">\n <span className=\"text-xs font-medium text-text-secondary\">\n {role.key ? t(role.key, role.label) : role.label} ·{' '}\n {formatRelativeTime(message.createdAt)}\n </span>\n <span className=\"text-sm whitespace-pre-wrap text-text-primary\">{message.text}</span>\n </li>\n );\n })}\n </ol>\n );\n};\n\nconst HandoffRow: FC<{\n handoff: HandoffRecord;\n agents: Map<string, string>;\n members: DirectoryMember[];\n isNew: boolean;\n canManage: boolean;\n onChanged: () => void;\n /** True when a notification deep-linked to this handoff. */\n linked?: boolean;\n}> = ({ handoff, agents, members, isNew, canManage, onChanged, linked = false }) => {\n const t = useTr();\n const [accept, acceptState] = useAcceptHandoff();\n const [release, releaseState] = useReleaseHandoff();\n const [resolve, resolveState] = useResolveHandoff();\n const [reject, rejectState] = useRejectHandoff();\n const [assign, assignState] = useAssignHandoff();\n const [reply, replyState] = useReplyToHandoff();\n const active = isActiveHandoff(handoff.status);\n const accepted = handoff.status === BotmanorHandoffStatus.Accepted;\n // Collapsed until the operator opens it: a long queue must not load every\n // thread. A deep-linked row starts open; the operator's own toggle wins\n // until the link changes (derived in render, no state sync effect).\n const [threadChoice, setThreadChoice] = useState<{ linked: boolean; open: boolean } | null>(null);\n const showThread = threadChoice && threadChoice.linked === linked ? threadChoice.open : linked;\n const rowRef = useRef<HTMLLIElement>(null);\n // Bring the deep-linked handoff into view once it renders.\n useEffect(() => {\n if (linked) rowRef.current?.scrollIntoView?.({ block: 'center', behavior: 'smooth' });\n }, [linked]);\n const thread = useHandoffTranscript(showThread ? handoff.id : undefined);\n const refetchThread = thread.refetch;\n // New customer messages arrive while the thread is open and a human is needed.\n useEffect(() => {\n if (!showThread || !active) return undefined;\n const timer = window.setInterval(() => {\n void refetchThread();\n }, TRANSCRIPT_REFRESH_MS);\n return () => window.clearInterval(timer);\n }, [showThread, active, refetchThread]);\n const [draft, setDraft] = useState('');\n const [assignee, setAssignee] = useState('');\n const busy =\n acceptState.loading ||\n releaseState.loading ||\n resolveState.loading ||\n rejectState.loading ||\n assignState.loading ||\n replyState.loading;\n const transitionError =\n acceptState.error ??\n releaseState.error ??\n resolveState.error ??\n rejectState.error ??\n assignState.error ??\n replyState.error;\n // A teammate changed this handoff first (took it over, resolved it, …).\n const conflict = transitionError ? isHandoffConflict(transitionError) : false;\n const memberName = (userId: string) =>\n members.find((member) => member.userId === userId)?.displayName ?? shortUserLabel(userId);\n\n const sendReply = async (event: FormEvent) => {\n event.preventDefault();\n const message = draft.trim();\n if (!message) return;\n try {\n await reply({ id: handoff.id, message });\n setDraft('');\n await thread.refetch();\n onChanged();\n } catch {\n /* the hook state already carries the message */\n }\n };\n\n const assignTo = async (event: FormEvent) => {\n event.preventDefault();\n const assigneeId = assignee.trim();\n if (!assigneeId) return;\n try {\n await assign({ id: handoff.id, assigneeId });\n setAssignee('');\n onChanged();\n } catch {\n /* the hook state already carries the message */\n }\n };\n\n const run = async (action: (id: string) => Promise<unknown>) => {\n try {\n await action(handoff.id);\n onChanged();\n } catch (error) {\n // The hook state carries the message; a lost race also re-reads the\n // inbox so the row shows who has it now.\n if (isHandoffConflict(error)) onChanged();\n }\n };\n\n return (\n <li\n ref={rowRef}\n data-testid={`handoff-row-${handoff.id}`}\n aria-current={linked ? 'true' : undefined}\n className={`grid gap-3 rounded-card border bg-bg-surface p-4 ${\n linked ? 'border-primary ring-2 ring-primary' : 'border-border-seam'\n }`}\n >\n <div className=\"flex flex-wrap items-center gap-2\">\n {isNew ? <Badge variant=\"default\">{t('botlit.handoffs.new', 'New')}</Badge> : null}\n <StatusBadge status={handoff.status} />\n <TriggerBadge handoff={handoff} />\n <SlaBadge handoff={handoff} />\n {handoff.replyChannel ? <Badge variant=\"outline\">{handoff.replyChannel}</Badge> : null}\n <span className=\"text-xs text-text-secondary\">\n {t('botlit.handoffs.opened', 'Opened {{time}}', {\n time: formatRelativeTime(handoff.createdAt),\n })}\n </span>\n </div>\n <p className=\"text-sm text-text-primary\">{handoff.reason}</p>\n {handoff.userMessage ? (\n <blockquote className=\"border-l-2 border-border-seam pl-3 text-sm text-text-secondary italic\">\n {handoff.userMessage}\n </blockquote>\n ) : null}\n <div className=\"flex flex-wrap items-center gap-2 text-xs text-text-secondary\">\n <span>\n {agents.get(handoff.agentId)\n ? t('botlit.handoffs.agent', 'Agent {{name}}', {\n name: agents.get(handoff.agentId) as string,\n })\n : t('botlit.handoffs.conversation', 'Conversation {{key}}', {\n key: handoff.conversationKey,\n })}\n </span>\n {handoff.assignedToId ? (\n <span>\n {t('botlit.handoffs.assignedTo', '· with {{who}}', {\n who: memberName(handoff.assignedToId),\n })}\n </span>\n ) : null}\n </div>\n <div>\n <Button\n size=\"sm\"\n variant=\"ghost\"\n aria-expanded={showThread}\n onClick={() => setThreadChoice({ linked, open: !showThread })}\n >\n {showThread\n ? t('botlit.handoffs.thread.hide', 'Hide conversation')\n : t('botlit.handoffs.thread.show', 'Show conversation')}\n </Button>\n </div>\n {showThread ? (\n thread.loading && thread.data.length === 0 ? (\n <p role=\"status\" className=\"text-sm text-text-secondary\">\n {t('botlit.handoffs.thread.loading', 'Loading conversation…')}\n </p>\n ) : thread.error ? (\n <p role=\"alert\" className=\"text-sm text-status-danger-text\">\n {thread.error.message}\n </p>\n ) : (\n <HandoffThread handoffId={handoff.id} messages={thread.data} />\n )\n ) : null}\n {canManage && accepted && handoff.replyChannel ? (\n <form className=\"grid gap-2\" onSubmit={(event) => void sendReply(event)}>\n <label className=\"text-sm font-medium text-text-primary\" htmlFor={`reply-${handoff.id}`}>\n {t('botlit.handoffs.reply.label', 'Reply to the customer')}\n </label>\n <Textarea\n id={`reply-${handoff.id}`}\n value={draft}\n maxLength={4000}\n rows={3}\n onChange={(event) => setDraft(event.target.value)}\n placeholder={t(\n 'botlit.handoffs.reply.placeholder',\n 'Sent in the same thread as the bot — the bot stays quiet until you hand back.'\n )}\n />\n <div>\n <Button size=\"sm\" type=\"submit\" disabled={busy || !draft.trim()}>\n {t('botlit.handoffs.reply.send', 'Send reply')}\n </Button>\n </div>\n </form>\n ) : null}\n {accepted && !handoff.replyChannel ? (\n <p className=\"text-sm text-text-secondary\">\n {t(\n 'botlit.handoffs.reply.webChat',\n 'This conversation came from web chat, which has no channel to reply on.'\n )}\n </p>\n ) : null}\n {canManage && active ? (\n <form\n className=\"flex flex-wrap items-center gap-2\"\n onSubmit={(event) => void assignTo(event)}\n >\n <label className=\"sr-only\" htmlFor={`assign-${handoff.id}`}>\n {t('botlit.handoffs.assign.label', 'Assign to a teammate')}\n </label>\n <select\n id={`assign-${handoff.id}`}\n className=\"h-9 max-w-xs rounded-md border border-border-default bg-bg-surface px-3 text-sm text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]\"\n value={assignee}\n onChange={(event) => setAssignee(event.target.value)}\n >\n <option value=\"\">{t('botlit.handoffs.assign.placeholder', 'Choose a teammate')}</option>\n {members\n .filter((member) => member.userId !== handoff.assignedToId)\n .map((member) => (\n <option key={member.userId} value={member.userId}>\n {member.email ? `${member.displayName} (${member.email})` : member.displayName}\n </option>\n ))}\n </select>\n <Button size=\"sm\" variant=\"outline\" type=\"submit\" disabled={busy || !assignee.trim()}>\n {t('botlit.handoffs.assign.submit', 'Assign')}\n </Button>\n </form>\n ) : null}\n {transitionError ? (\n <div\n role=\"alert\"\n className=\"flex flex-wrap items-center gap-2 text-sm text-status-danger-text\"\n >\n <span>\n {conflict\n ? t(\n 'botlit.handoffs.conflict',\n 'A teammate changed this handoff first (for example, took it over). The inbox has been refreshed.'\n )\n : transitionError.message}\n </span>\n </div>\n ) : null}\n {canManage ? (\n <div className=\"flex flex-wrap gap-2\">\n {handoff.status === BotmanorHandoffStatus.Requested ||\n handoff.status === BotmanorHandoffStatus.Assigned ? (\n <>\n <Button size=\"sm\" disabled={busy} onClick={() => void run(accept)}>\n {t('botlit.handoffs.actions.takeOver', 'Take over')}\n </Button>\n <Button size=\"sm\" variant=\"outline\" disabled={busy} onClick={() => void run(reject)}>\n {t('botlit.handoffs.actions.reject', 'Reject')}\n </Button>\n </>\n ) : null}\n {handoff.status === BotmanorHandoffStatus.Accepted ? (\n <>\n <Button size=\"sm\" variant=\"outline\" disabled={busy} onClick={() => void run(release)}>\n {t('botlit.handoffs.actions.handBack', 'Hand back to bot')}\n </Button>\n <Button size=\"sm\" disabled={busy} onClick={() => void run(resolve)}>\n {t('botlit.handoffs.actions.resolve', 'Resolve')}\n </Button>\n </>\n ) : null}\n </div>\n ) : null}\n </li>\n );\n};\n\n/**\n * Says when the handoff a notification links to is not in the list.\n * `items` is null while the queue is loading or failed.\n */\nconst LinkedHandoffNotice: FC<{\n linkedId: string | null;\n filter: QueueFilter;\n items: ReadonlyArray<{ id: string }> | null;\n}> = ({ linkedId, filter, items }) => {\n const t = useTr();\n if (!linkedId || !items || items.some((handoff) => handoff.id === linkedId)) return null;\n return (\n <p role=\"status\" className=\"text-sm text-text-secondary\" data-testid=\"handoff-link-missing\">\n {filter === 'all'\n ? t(\n 'botlit.handoffs.linkMissing',\n 'The handoff from your notification could not be found. It may have been removed.'\n )\n : t(\n 'botlit.handoffs.linkMissingFiltered',\n 'The handoff from your notification is not in this list. Switch to All to see every status.'\n )}\n </p>\n );\n};\n\n/**\n * The queue filter. A linked handoff may already be closed, so each new link\n * opens on every status; the operator's own pick wins until the link changes,\n * also when a second notification is opened on this page (derived in render).\n */\nfunction useDeepLinkFilter(linkedId: string | null): [QueueFilter, (next: QueueFilter) => void] {\n const [choice, setChoice] = useState<{ linkedId: string | null; filter: QueueFilter } | null>(\n null\n );\n const fallback: QueueFilter = linkedId ? 'all' : 'active';\n const filter = choice && choice.linkedId === linkedId ? choice.filter : fallback;\n return [filter, (next) => setChoice({ linkedId, filter: next })];\n}\n\nexport const HandoffsPage: FC = () => {\n const t = useTr();\n const canManage = useBotmanorPermission(BOTMANOR_PERMISSIONS.AGENT_UPDATE);\n const [searchParams] = useSearchParams();\n const linkedId = searchParams.get(HANDOFF_QUERY_PARAM)?.trim() || null;\n const [filter, setFilter] = useDeepLinkFilter(linkedId);\n const active = FILTERS.find((entry) => entry.id === filter) ?? FILTERS[0];\n const queue = useHandoffInbox({ statuses: active.statuses ?? undefined });\n const directory = useWorkspaceMemberDirectory();\n const agents = useAgents();\n const agentNames = useMemo(\n () => new Map((agents.data ?? []).map((agent) => [agent.id, agent.name])),\n [agents.data]\n );\n\n return (\n <PageLayout\n title={t('botlit.handoffs.title', 'Human Handoffs')}\n description={t(\n 'botlit.handoffs.description',\n 'Conversations the runtime handed to your team. Taking one over stops the bot from replying until you hand it back.'\n )}\n >\n <div className=\"mx-auto flex w-full max-w-4xl flex-col gap-4 p-4\">\n <div className=\"flex flex-wrap items-center gap-2\">\n {FILTERS.map((entry) => (\n <Button\n key={entry.id}\n size=\"sm\"\n variant={filter === entry.id ? 'primary' : 'outline'}\n onClick={() => setFilter(entry.id)}\n >\n {t(entry.labelKey, entry.label)}\n </Button>\n ))}\n <Button\n size=\"sm\"\n variant=\"outline\"\n isLoading={queue.refreshing}\n onClick={() => void queue.refresh()}\n >\n {t('botlit.handoffs.refresh', 'Refresh')}\n </Button>\n <span className=\"text-xs text-text-secondary\">\n {t('botlit.handoffs.autoRefresh', 'Updates automatically while this page is open.')}\n </span>\n </div>\n\n <LinkedHandoffNotice\n linkedId={linkedId}\n filter={filter}\n items={queue.loading || queue.error ? null : queue.items}\n />\n\n <div aria-live=\"polite\">\n {queue.newIds.size > 0 ? (\n <div className=\"flex flex-wrap items-center gap-2 rounded-card border border-status-info-border bg-status-info-bg-subtle p-3 text-sm text-text-primary\">\n <span>\n {t('botlit.handoffs.newArrived', '{{count}} new handoff(s) arrived.', {\n count: queue.newIds.size,\n })}\n </span>\n <Button size=\"sm\" variant=\"ghost\" onClick={queue.acknowledgeNew}>\n {t('botlit.handoffs.markSeen', 'Mark as seen')}\n </Button>\n </div>\n ) : null}\n </div>\n\n {queue.loading && queue.items.length === 0 ? (\n <p role=\"status\">{t('botlit.handoffs.loading', 'Loading handoffs…')}</p>\n ) : queue.error && queue.items.length === 0 ? (\n <ErrorState\n resource={t('botlit.handoffs.errorResource', 'handoffs')}\n error={queue.error}\n onRetry={() => void queue.refresh()}\n />\n ) : queue.items.length > 0 ? (\n <Card>\n <CardHeader>\n <CardTitle>{t('botlit.handoffs.queue', 'Team inbox')}</CardTitle>\n <CardDescription>\n {t(\n 'botlit.handoffs.queueDescription',\n 'Newest first — accept a conversation to take it over.'\n )}\n </CardDescription>\n </CardHeader>\n <CardContent>\n {queue.error ? (\n <p role=\"alert\" className=\"mb-3 text-sm text-status-danger-text\">\n {t('botlit.handoffs.refreshFailed', 'Could not refresh the inbox: {{message}}', {\n message: queue.error.message,\n })}\n </p>\n ) : null}\n <ul className=\"grid gap-3\">\n {queue.items.map((handoff) => (\n <HandoffRow\n key={handoff.id}\n handoff={handoff}\n agents={agentNames}\n members={directory.members}\n isNew={queue.newIds.has(handoff.id)}\n canManage={canManage}\n onChanged={() => void queue.refresh()}\n linked={handoff.id === linkedId}\n />\n ))}\n </ul>\n </CardContent>\n </Card>\n ) : (\n <EmptyState\n title={t('botlit.handoffs.empty', 'No handoffs')}\n description={t(\n 'botlit.handoffs.emptyDescription',\n 'Nothing needs a human right now. Triggered handoffs from your agents land here.'\n )}\n />\n )}\n <LoadMore\n hasMore={queue.hasMore}\n loadingMore={queue.loadingMore}\n onLoadMore={() => void queue.loadMore()}\n loadedCount={queue.items.length}\n />\n </div>\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA8DA,IAAaE,IAAsB,WAE7BC,IAKD;CACH;EACE,IAAI;EACJ,UAAU;GACRC,EAAsB;GACtBA,EAAsB;GACtBA,EAAsB;EACxB;EACA,UAAU;EACV,OAAO;CACT;CACA;EACE,IAAI;EACJ,UAAU;GACRA,EAAsB;GACtBA,EAAsB;GACtBA,EAAsB;EACxB;EACA,UAAU;EACV,OAAO;CACT;CACA;EAAE,IAAI;EAAO,UAAU;EAAM,UAAU;EAA8B,OAAO;CAAM;AACpF,GAEMC,MAAgD,EAAE,iBAAc;CACpE,IAAMC,IAAIC,EAAM,GACVC,IAAiC;EACrC,kBAAkBF,EAAE,2CAA2C,kBAAkB;EACjF,eAAeA,EAAE,wCAAwC,eAAe;EACxE,gBAAgBA,EAAE,yCAAyC,gBAAgB;EAC3E,mBAAmBA,EAAE,4CAA4C,mBAAmB;EACp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A;AAEhB"}
@@ -32,6 +32,7 @@ export declare const BOTMANOR_PERMISSIONS: {
32
32
  readonly AGENT_ROLLBACK: "botmanor-agent:rollback";
33
33
  readonly AGENT_EXECUTE: "botmanor-agent:execute";
34
34
  readonly AGENT_APPROVE: "botmanor-agent:approve";
35
+ readonly AI_PREDICTION_UPDATE: "botmanor-ai-prediction:update";
35
36
  readonly KNOWLEDGE_CREATE: "botmanor-knowledge-base:create";
36
37
  readonly KNOWLEDGE_UPDATE: "botmanor-knowledge-base:update";
37
38
  readonly KNOWLEDGE_DELETE: "botmanor-knowledge-base:delete";
@@ -19,6 +19,7 @@ var e = {
19
19
  AGENT_ROLLBACK: "botmanor-agent:rollback",
20
20
  AGENT_EXECUTE: "botmanor-agent:execute",
21
21
  AGENT_APPROVE: "botmanor-agent:approve",
22
+ AI_PREDICTION_UPDATE: "botmanor-ai-prediction:update",
22
23
  KNOWLEDGE_CREATE: "botmanor-knowledge-base:create",
23
24
  KNOWLEDGE_UPDATE: "botmanor-knowledge-base:update",
24
25
  KNOWLEDGE_DELETE: "botmanor-knowledge-base:delete",
@@ -1 +1 @@
1
- {"version":3,"file":"botmanorPermissions.js","names":["BOTMANOR_PERMISSIONS"],"sources":["../../../src/botlit/permissions/botmanorPermissions.ts"],"sourcesContent":["/**\n * BotManor permission catalogue\n * @module botlit/permissions\n *\n * The `resource:action` pairs the BotManor UI checks before it offers a write\n * control. Every pair mirrors the `@rbac(resource, action)` directive on the\n * wspace-botmanor-svc mutation that the control calls, so the UI hides exactly\n * what the gateway would refuse. The gateway stays the only enforcement point:\n * hiding a button never grants or denies anything, it only stops a member from\n * attempting an action the gateway will answer with FORBIDDEN.\n *\n * Keep this file in step with the service schema. When a mutation's directive\n * changes, change the pair here and the control that calls it.\n */\n\nexport const BOTMANOR_PERMISSIONS = {\n // Read permissions the dashboard checks before it queries a list. They mirror\n // the `@rbac` read pairs the shell's sidebar uses (`botlit-app` navPermissions).\n APP_READ: 'botmanor-app:read',\n AGENT_READ: 'botmanor-agent:read',\n CHANNEL_MESSAGE_READ: 'botmanor-channel-message:read',\n // Run stats and live run updates (getDailyUsageStats, botmanorExecutionUpdated)\n EXECUTION_READ: 'botmanor-execution:read',\n\n // Bot apps — createBotApp / updateBotApp / deleteBotApp / publishBotAppVersion /\n // rollbackBotAppVersion\n APP_CREATE: 'botmanor-app:create',\n APP_UPDATE: 'botmanor-app:update',\n APP_DELETE: 'botmanor-app:delete',\n APP_PUBLISH: 'botmanor-app:publish',\n APP_ROLLBACK: 'botmanor-app:rollback',\n\n // Agents behind an app — createAppAgent / updateAppAgent / deleteAppAgent\n APP_AGENT_CREATE: 'botmanor-app-agent:create',\n APP_AGENT_UPDATE: 'botmanor-app-agent:update',\n APP_AGENT_DELETE: 'botmanor-app-agent:delete',\n\n // Agents — createBotmanorAgent / updateBotmanorAgent / deleteBotmanorAgent /\n // publishAgentVersion / rollbackAgentVersion / chatWithAgent /\n // approve|rejectBotmanorAgentActivation / updateBotmanorAgentApprovalSettings /\n // configureAssistantRuntime / publishAssistantWebsite / configureAssistantChannel\n AGENT_CREATE: 'botmanor-agent:create',\n AGENT_UPDATE: 'botmanor-agent:update',\n AGENT_DELETE: 'botmanor-agent:delete',\n AGENT_PUBLISH: 'botmanor-agent:publish',\n AGENT_ROLLBACK: 'botmanor-agent:rollback',\n AGENT_EXECUTE: 'botmanor-agent:execute',\n AGENT_APPROVE: 'botmanor-agent:approve',\n\n // Knowledge bases — createKnowledgeBase / addKnowledgeDocument /\n // updateKnowledgeBase / deleteKnowledgeBase / removeKnowledgeDocument /\n // rebuildKnowledgeBaseIndex / queueKnowledgeSource / retry*\n KNOWLEDGE_CREATE: 'botmanor-knowledge-base:create',\n KNOWLEDGE_UPDATE: 'botmanor-knowledge-base:update',\n KNOWLEDGE_DELETE: 'botmanor-knowledge-base:delete',\n KNOWLEDGE_MANAGE: 'botmanor-knowledge-base:manage',\n\n // Retrieval profiles\n RETRIEVAL_PROFILE_CREATE: 'botmanor-retrieval-profile:create',\n RETRIEVAL_PROFILE_UPDATE: 'botmanor-retrieval-profile:update',\n RETRIEVAL_PROFILE_DELETE: 'botmanor-retrieval-profile:delete',\n\n // MCP servers — create/update/deleteMCPConnection, updateMCPTool,\n // testMCPConnection, refreshMCPTools / refreshMCPResources / callMCPTool\n MCP_CREATE: 'botmanor-mcp:create',\n MCP_UPDATE: 'botmanor-mcp:update',\n MCP_DELETE: 'botmanor-mcp:delete',\n MCP_TEST: 'botmanor-mcp:test',\n MCP_EXECUTE: 'botmanor-mcp:execute',\n\n // LLM providers and models — create/update/delete*, testLlmConnection\n LLM_CREATE: 'botmanor-llm:create',\n LLM_UPDATE: 'botmanor-llm:update',\n LLM_DELETE: 'botmanor-llm:delete',\n LLM_TEST: 'botmanor-llm:test',\n\n // A2A — create/update/deleteA2AConnection, sendA2AMessage, delegateA2ATask\n A2A_CREATE: 'botmanor-a2a:create',\n A2A_UPDATE: 'botmanor-a2a:update',\n A2A_DELETE: 'botmanor-a2a:delete',\n A2A_SEND: 'botmanor-a2a:send',\n A2A_EXECUTE: 'botmanor-a2a:execute',\n\n // A2A registry (the external agents the Registry page lists) —\n // create/update/deleteA2ARegistryEntry\n A2A_REGISTRY_CREATE: 'botmanor-a2a-registry:create',\n A2A_REGISTRY_UPDATE: 'botmanor-a2a-registry:update',\n A2A_REGISTRY_DELETE: 'botmanor-a2a-registry:delete',\n\n // Channels — connectors and routes\n CHANNEL_CREATE: 'botmanor-channel:create',\n CHANNEL_UPDATE: 'botmanor-channel:update',\n CHANNEL_DELETE: 'botmanor-channel:delete',\n // sendChannelMessage is :create, handleChannelMessage is :execute\n CHANNEL_MESSAGE_CREATE: 'botmanor-channel-message:create',\n CHANNEL_MESSAGE_EXECUTE: 'botmanor-channel-message:execute',\n\n // Policies\n POLICY_CREATE: 'botmanor-policy:create',\n POLICY_UPDATE: 'botmanor-policy:update',\n POLICY_DELETE: 'botmanor-policy:delete',\n\n // Skills\n SKILL_CREATE: 'botmanor-skill:create',\n SKILL_UPDATE: 'botmanor-skill:update',\n SKILL_DELETE: 'botmanor-skill:delete',\n\n // Prompt templates — create/duplicate share :create; renderPromptTemplate is :execute\n PROMPT_TEMPLATE_CREATE: 'botmanor-prompt-template:create',\n PROMPT_TEMPLATE_UPDATE: 'botmanor-prompt-template:update',\n PROMPT_TEMPLATE_DELETE: 'botmanor-prompt-template:delete',\n PROMPT_TEMPLATE_EXECUTE: 'botmanor-prompt-template:execute',\n\n // Executions — createExecution / triggerBotmanorBoundWorkflow are :create,\n // runExecution / updateExecutionStatus are :update\n EXECUTION_CREATE: 'botmanor-execution:create',\n EXECUTION_UPDATE: 'botmanor-execution:update',\n\n // Buckets\n BUCKET_CREATE: 'botmanor-bucket:create',\n BUCKET_UPDATE: 'botmanor-bucket:update',\n BUCKET_DELETE: 'botmanor-bucket:delete',\n\n // Store — installPackage / forkInstalledPackage are :create,\n // updateInstalledPackage :update, uninstallPackage :delete\n STORE_CREATE: 'botmanor-store:create',\n STORE_UPDATE: 'botmanor-store:update',\n STORE_DELETE: 'botmanor-store:delete',\n\n // Agent and app templates\n TEMPLATE_CREATE: 'botmanor-template:create',\n TEMPLATE_UPDATE: 'botmanor-template:update',\n TEMPLATE_DELETE: 'botmanor-template:delete',\n} as const;\n\nexport type BotmanorPermission = (typeof BOTMANOR_PERMISSIONS)[keyof typeof BOTMANOR_PERMISSIONS];\n"],"mappings":";AAeA,IAAaA,IAAuB;CAGlC,UAAU;CACV,YAAY;CACZ,sBAAsB;CAEtB,gBAAgB;CAIhB,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,aAAa;CACb,cAAc;CAGd,kBAAkB;CAClB,kBAAkB;CAClB,kBAAkB;CAMlB,cAAc;CACd,cAAc;CACd,cAAc;CACd,eAAe;CACf,gBAAgB;CAChB,eAAe;CACf,eAAe;CAKf,kBAAkB;CAClB,kBAAkB;CAClB,kBAAkB;CAClB,kBAAkB;CAGlB,0BAA0B;CAC1B,0BAA0B;CAC1B,0BAA0B;CAI1B,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,UAAU;CACV,aAAa;CAGb,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,UAAU;CAGV,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,UAAU;CACV,aAAa;CAIb,qBAAqB;CACrB,qBAAqB;CACrB,qBAAqB;CAGrB,gBAAgB;CAChB,gBAAgB;CAChB,gBAAgB;CAEhB,wBAAwB;CACxB,yBAAyB;CAGzB,eAAe;CACf,eAAe;CACf,eAAe;CAGf,cAAc;CACd,cAAc;CACd,cAAc;CAGd,wBAAwB;CACxB,wBAAwB;CACxB,wBAAwB;CACxB,yBAAyB;CAIzB,kBAAkB;CAClB,kBAAkB;CAGlB,eAAe;CACf,eAAe;CACf,eAAe;CAIf,cAAc;CACd,cAAc;CACd,cAAc;CAGd,iBAAiB;CACjB,iBAAiB;CACjB,iBAAiB;AACnB"}
1
+ {"version":3,"file":"botmanorPermissions.js","names":["BOTMANOR_PERMISSIONS"],"sources":["../../../src/botlit/permissions/botmanorPermissions.ts"],"sourcesContent":["/**\n * BotManor permission catalogue\n * @module botlit/permissions\n *\n * The `resource:action` pairs the BotManor UI checks before it offers a write\n * control. Every pair mirrors the `@rbac(resource, action)` directive on the\n * wspace-botmanor-svc mutation that the control calls, so the UI hides exactly\n * what the gateway would refuse. The gateway stays the only enforcement point:\n * hiding a button never grants or denies anything, it only stops a member from\n * attempting an action the gateway will answer with FORBIDDEN.\n *\n * Keep this file in step with the service schema. When a mutation's directive\n * changes, change the pair here and the control that calls it.\n */\n\nexport const BOTMANOR_PERMISSIONS = {\n // Read permissions the dashboard checks before it queries a list. They mirror\n // the `@rbac` read pairs the shell's sidebar uses (`botlit-app` navPermissions).\n APP_READ: 'botmanor-app:read',\n AGENT_READ: 'botmanor-agent:read',\n CHANNEL_MESSAGE_READ: 'botmanor-channel-message:read',\n // Run stats and live run updates (getDailyUsageStats, botmanorExecutionUpdated)\n EXECUTION_READ: 'botmanor-execution:read',\n\n // Bot apps — createBotApp / updateBotApp / deleteBotApp / publishBotAppVersion /\n // rollbackBotAppVersion\n APP_CREATE: 'botmanor-app:create',\n APP_UPDATE: 'botmanor-app:update',\n APP_DELETE: 'botmanor-app:delete',\n APP_PUBLISH: 'botmanor-app:publish',\n APP_ROLLBACK: 'botmanor-app:rollback',\n\n // Agents behind an app — createAppAgent / updateAppAgent / deleteAppAgent\n APP_AGENT_CREATE: 'botmanor-app-agent:create',\n APP_AGENT_UPDATE: 'botmanor-app-agent:update',\n APP_AGENT_DELETE: 'botmanor-app-agent:delete',\n\n // Agents — createBotmanorAgent / updateBotmanorAgent / deleteBotmanorAgent /\n // publishAgentVersion / rollbackAgentVersion / chatWithAgent /\n // approve|rejectBotmanorAgentActivation / updateBotmanorAgentApprovalSettings /\n // configureAssistantRuntime / publishAssistantWebsite / configureAssistantChannel\n AGENT_CREATE: 'botmanor-agent:create',\n AGENT_UPDATE: 'botmanor-agent:update',\n AGENT_DELETE: 'botmanor-agent:delete',\n AGENT_PUBLISH: 'botmanor-agent:publish',\n AGENT_ROLLBACK: 'botmanor-agent:rollback',\n AGENT_EXECUTE: 'botmanor-agent:execute',\n AGENT_APPROVE: 'botmanor-agent:approve',\n\n // Supervisor runs and schedule changes use the AI prediction update permission.\n AI_PREDICTION_UPDATE: 'botmanor-ai-prediction:update',\n\n // Knowledge bases — createKnowledgeBase / addKnowledgeDocument /\n // updateKnowledgeBase / deleteKnowledgeBase / removeKnowledgeDocument /\n // rebuildKnowledgeBaseIndex / queueKnowledgeSource / retry*\n KNOWLEDGE_CREATE: 'botmanor-knowledge-base:create',\n KNOWLEDGE_UPDATE: 'botmanor-knowledge-base:update',\n KNOWLEDGE_DELETE: 'botmanor-knowledge-base:delete',\n KNOWLEDGE_MANAGE: 'botmanor-knowledge-base:manage',\n\n // Retrieval profiles\n RETRIEVAL_PROFILE_CREATE: 'botmanor-retrieval-profile:create',\n RETRIEVAL_PROFILE_UPDATE: 'botmanor-retrieval-profile:update',\n RETRIEVAL_PROFILE_DELETE: 'botmanor-retrieval-profile:delete',\n\n // MCP servers — create/update/deleteMCPConnection, updateMCPTool,\n // testMCPConnection, refreshMCPTools / refreshMCPResources / callMCPTool\n MCP_CREATE: 'botmanor-mcp:create',\n MCP_UPDATE: 'botmanor-mcp:update',\n MCP_DELETE: 'botmanor-mcp:delete',\n MCP_TEST: 'botmanor-mcp:test',\n MCP_EXECUTE: 'botmanor-mcp:execute',\n\n // LLM providers and models — create/update/delete*, testLlmConnection\n LLM_CREATE: 'botmanor-llm:create',\n LLM_UPDATE: 'botmanor-llm:update',\n LLM_DELETE: 'botmanor-llm:delete',\n LLM_TEST: 'botmanor-llm:test',\n\n // A2A — create/update/deleteA2AConnection, sendA2AMessage, delegateA2ATask\n A2A_CREATE: 'botmanor-a2a:create',\n A2A_UPDATE: 'botmanor-a2a:update',\n A2A_DELETE: 'botmanor-a2a:delete',\n A2A_SEND: 'botmanor-a2a:send',\n A2A_EXECUTE: 'botmanor-a2a:execute',\n\n // A2A registry (the external agents the Registry page lists) —\n // create/update/deleteA2ARegistryEntry\n A2A_REGISTRY_CREATE: 'botmanor-a2a-registry:create',\n A2A_REGISTRY_UPDATE: 'botmanor-a2a-registry:update',\n A2A_REGISTRY_DELETE: 'botmanor-a2a-registry:delete',\n\n // Channels — connectors and routes\n CHANNEL_CREATE: 'botmanor-channel:create',\n CHANNEL_UPDATE: 'botmanor-channel:update',\n CHANNEL_DELETE: 'botmanor-channel:delete',\n // sendChannelMessage is :create, handleChannelMessage is :execute\n CHANNEL_MESSAGE_CREATE: 'botmanor-channel-message:create',\n CHANNEL_MESSAGE_EXECUTE: 'botmanor-channel-message:execute',\n\n // Policies\n POLICY_CREATE: 'botmanor-policy:create',\n POLICY_UPDATE: 'botmanor-policy:update',\n POLICY_DELETE: 'botmanor-policy:delete',\n\n // Skills\n SKILL_CREATE: 'botmanor-skill:create',\n SKILL_UPDATE: 'botmanor-skill:update',\n SKILL_DELETE: 'botmanor-skill:delete',\n\n // Prompt templates — create/duplicate share :create; renderPromptTemplate is :execute\n PROMPT_TEMPLATE_CREATE: 'botmanor-prompt-template:create',\n PROMPT_TEMPLATE_UPDATE: 'botmanor-prompt-template:update',\n PROMPT_TEMPLATE_DELETE: 'botmanor-prompt-template:delete',\n PROMPT_TEMPLATE_EXECUTE: 'botmanor-prompt-template:execute',\n\n // Executions — createExecution / triggerBotmanorBoundWorkflow are :create,\n // runExecution / updateExecutionStatus are :update\n EXECUTION_CREATE: 'botmanor-execution:create',\n EXECUTION_UPDATE: 'botmanor-execution:update',\n\n // Buckets\n BUCKET_CREATE: 'botmanor-bucket:create',\n BUCKET_UPDATE: 'botmanor-bucket:update',\n BUCKET_DELETE: 'botmanor-bucket:delete',\n\n // Store — installPackage / forkInstalledPackage are :create,\n // updateInstalledPackage :update, uninstallPackage :delete\n STORE_CREATE: 'botmanor-store:create',\n STORE_UPDATE: 'botmanor-store:update',\n STORE_DELETE: 'botmanor-store:delete',\n\n // Agent and app templates\n TEMPLATE_CREATE: 'botmanor-template:create',\n TEMPLATE_UPDATE: 'botmanor-template:update',\n TEMPLATE_DELETE: 'botmanor-template:delete',\n} as const;\n\nexport type BotmanorPermission = (typeof BOTMANOR_PERMISSIONS)[keyof typeof BOTMANOR_PERMISSIONS];\n"],"mappings":";AAeA,IAAaA,IAAuB;CAGlC,UAAU;CACV,YAAY;CACZ,sBAAsB;CAEtB,gBAAgB;CAIhB,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,aAAa;CACb,cAAc;CAGd,kBAAkB;CAClB,kBAAkB;CAClB,kBAAkB;CAMlB,cAAc;CACd,cAAc;CACd,cAAc;CACd,eAAe;CACf,gBAAgB;CAChB,eAAe;CACf,eAAe;CAGf,sBAAsB;CAKtB,kBAAkB;CAClB,kBAAkB;CAClB,kBAAkB;CAClB,kBAAkB;CAGlB,0BAA0B;CAC1B,0BAA0B;CAC1B,0BAA0B;CAI1B,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,UAAU;CACV,aAAa;CAGb,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,UAAU;CAGV,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,UAAU;CACV,aAAa;CAIb,qBAAqB;CACrB,qBAAqB;CACrB,qBAAqB;CAGrB,gBAAgB;CAChB,gBAAgB;CAChB,gBAAgB;CAEhB,wBAAwB;CACxB,yBAAyB;CAGzB,eAAe;CACf,eAAe;CACf,eAAe;CAGf,cAAc;CACd,cAAc;CACd,cAAc;CAGd,wBAAwB;CACxB,wBAAwB;CACxB,wBAAwB;CACxB,yBAAyB;CAIzB,kBAAkB;CAClB,kBAAkB;CAGlB,eAAe;CACf,eAAe;CACf,eAAe;CAIf,cAAc;CACd,cAAc;CACd,cAAc;CAGd,iBAAiB;CACjB,iBAAiB;CACjB,iBAAiB;AACnB"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Handoff inbox helpers (BOFF-15472)
3
+ * @module botlit/utils
4
+ *
5
+ * Pure logic behind the team inbox and the handoff routing pickers, kept out
6
+ * of the components so it is unit-tested on its own: page merging and new-item
7
+ * detection for the auto-refreshing queue, the "someone else got there first"
8
+ * check for a take-over, the role options of the routing select, and which
9
+ * integration connections can be linked to a platform channel.
10
+ */
11
+ /** How often the inbox re-reads the queue while the page is visible. */
12
+ export declare const INBOX_REFRESH_MS = 20000;
13
+ /** The server caps one queue page at 100 handoffs. */
14
+ export declare const INBOX_PAGE_SIZE = 100;
15
+ /** Concatenates queue pages in order, keeping the first copy of each id. */
16
+ export declare function mergeHandoffPages<T extends {
17
+ id: string;
18
+ }>(pages: readonly T[][]): T[];
19
+ /** Ids in `items` that were not in `known` (the previous read). */
20
+ export declare function newHandoffIds(known: ReadonlySet<string>, items: readonly {
21
+ id: string;
22
+ }[]): string[];
23
+ /**
24
+ * True when a handoff transition failed because the handoff moved on in the
25
+ * meantime, e.g. a teammate took it over first. The server reports that as
26
+ * FAILED_PRECONDITION (`handoff.errors.invalidTransition`).
27
+ */
28
+ export declare function isHandoffConflict(error: unknown): boolean;
29
+ /**
30
+ * Workspace membership roles the handoff runtime matches `targetRole`
31
+ * against (`WorkspaceMember.role`, compared case-insensitively).
32
+ */
33
+ export declare const DEFAULT_MEMBER_ROLES: readonly ["owner", "admin", "member", "viewer"];
34
+ /**
35
+ * The options of the "workspace role" select: the default membership roles,
36
+ * every role a member of this workspace actually holds, and the saved value
37
+ * even when nobody holds it any more, so opening the form never drops it.
38
+ * Roles are unique case-insensitively; the saved value's casing wins.
39
+ */
40
+ export declare function memberRoleOptions(memberRoles: readonly (string | null | undefined)[], current: string | null | undefined): string[];
41
+ export interface LinkableConnection {
42
+ id: string;
43
+ status: string;
44
+ provider: {
45
+ key: string;
46
+ name: string;
47
+ } | null;
48
+ }
49
+ /**
50
+ * The caller's integration connections that can be linked to a channel of
51
+ * `platform`: ACTIVE ones whose provider is that platform's.
52
+ */
53
+ export declare function linkableConnections<T extends LinkableConnection>(connections: readonly T[], platform: string): T[];
54
+ /** Members not yet chosen whose name or email contains the search text. */
55
+ export declare function teammateCandidates<T extends {
56
+ userId: string;
57
+ displayName: string;
58
+ email?: string | null;
59
+ }>(members: readonly T[], chosen: readonly string[], query: string): T[];
60
+ /**
61
+ * Where a listbox key moves the highlight (wrapping at both ends), or null
62
+ * when the key doesn't move it or the list is empty.
63
+ */
64
+ export declare function nextListboxIndex(key: string, index: number, count: number): number | null;
@@ -0,0 +1,62 @@
1
+ import { graphqlErrorCode as e } from "./errors.js";
2
+ // src/botlit/utils/handoffInbox.ts
3
+ var t = 2e4;
4
+ function n(e) {
5
+ let t = /* @__PURE__ */ new Set(), n = [];
6
+ for (let r of e) for (let e of r) t.has(e.id) || (t.add(e.id), n.push(e));
7
+ return n;
8
+ }
9
+ function r(e, t) {
10
+ return t.filter((t) => !e.has(t.id)).map((e) => e.id);
11
+ }
12
+ function i(t) {
13
+ return e(t) === "FAILED_PRECONDITION";
14
+ }
15
+ var a = [
16
+ "owner",
17
+ "admin",
18
+ "member",
19
+ "viewer"
20
+ ];
21
+ function o(e, t) {
22
+ let n = /* @__PURE__ */ new Map(), r = (e) => {
23
+ let t = e?.trim();
24
+ if (!t) return;
25
+ let r = t.toLowerCase();
26
+ n.has(r) || n.set(r, t);
27
+ };
28
+ a.forEach(r), e.forEach(r), r(t);
29
+ let i = t?.trim();
30
+ return i && n.set(i.toLowerCase(), i), [...n.values()];
31
+ }
32
+ var s = {
33
+ SLACK: ["slack"],
34
+ TEAMS: ["teams", "microsoft"],
35
+ DISCORD: ["discord"],
36
+ WHATSAPP: ["whatsapp"]
37
+ };
38
+ function c(e, t) {
39
+ let n = s[t.toUpperCase()] ?? [t.toLowerCase()];
40
+ return e.filter((e) => {
41
+ if (e.status !== "ACTIVE" || !e.provider) return !1;
42
+ let t = `${e.provider.key} ${e.provider.name}`.toLowerCase();
43
+ return n.some((e) => t.includes(e));
44
+ });
45
+ }
46
+ function l(e, t, n) {
47
+ let r = new Set(t), i = n.trim().toLowerCase();
48
+ return e.filter((e) => !r.has(e.userId) && (!i || e.displayName.toLowerCase().includes(i) || (e.email ?? "").toLowerCase().includes(i)));
49
+ }
50
+ var u = {
51
+ ArrowDown: (e, t) => (e + 1) % t,
52
+ ArrowUp: (e, t) => (e - 1 + t) % t,
53
+ Home: () => 0,
54
+ End: (e, t) => t - 1
55
+ };
56
+ function d(e, t, n) {
57
+ let r = u[e];
58
+ return r && n > 0 ? r(Math.max(t, 0), n) : null;
59
+ }
60
+ export { a as DEFAULT_MEMBER_ROLES, t as INBOX_REFRESH_MS, i as isHandoffConflict, c as linkableConnections, o as memberRoleOptions, n as mergeHandoffPages, r as newHandoffIds, d as nextListboxIndex, l as teammateCandidates };
61
+
62
+ //# sourceMappingURL=handoffInbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handoffInbox.js","names":["INBOX_REFRESH_MS","mergeHandoffPages","seen","merged","page","pages","item","newHandoffIds","items","known","isHandoffConflict","graphqlErrorCode","error","DEFAULT_MEMBER_ROLES","memberRoleOptions","byKey","add","trimmed","role","key","memberRoles","current","saved","PLATFORM_PROVIDER_HINTS","linkableConnections","hints","platform","connections","connection","haystack","hint","teammateCandidates","picked","chosen","needle","query","members","member","LISTBOX_MOVES","index","count","nextListboxIndex","move"],"sources":["../../../src/botlit/utils/handoffInbox.ts"],"sourcesContent":["/**\n * Handoff inbox helpers (BOFF-15472)\n * @module botlit/utils\n *\n * Pure logic behind the team inbox and the handoff routing pickers, kept out\n * of the components so it is unit-tested on its own: page merging and new-item\n * detection for the auto-refreshing queue, the \"someone else got there first\"\n * check for a take-over, the role options of the routing select, and which\n * integration connections can be linked to a platform channel.\n */\n\nimport { graphqlErrorCode } from './errors';\n\n/** How often the inbox re-reads the queue while the page is visible. */\nexport const INBOX_REFRESH_MS = 20_000;\n\n/** The server caps one queue page at 100 handoffs. */\nexport const INBOX_PAGE_SIZE = 100;\n\n/** Concatenates queue pages in order, keeping the first copy of each id. */\nexport function mergeHandoffPages<T extends { id: string }>(pages: readonly T[][]): T[] {\n const seen = new Set<string>();\n const merged: T[] = [];\n for (const page of pages) {\n for (const item of page) {\n if (seen.has(item.id)) continue;\n seen.add(item.id);\n merged.push(item);\n }\n }\n return merged;\n}\n\n/** Ids in `items` that were not in `known` (the previous read). */\nexport function newHandoffIds(\n known: ReadonlySet<string>,\n items: readonly { id: string }[]\n): string[] {\n return items.filter((item) => !known.has(item.id)).map((item) => item.id);\n}\n\n/**\n * True when a handoff transition failed because the handoff moved on in the\n * meantime, e.g. a teammate took it over first. The server reports that as\n * FAILED_PRECONDITION (`handoff.errors.invalidTransition`).\n */\nexport function isHandoffConflict(error: unknown): boolean {\n return graphqlErrorCode(error) === 'FAILED_PRECONDITION';\n}\n\n/**\n * Workspace membership roles the handoff runtime matches `targetRole`\n * against (`WorkspaceMember.role`, compared case-insensitively).\n */\nexport const DEFAULT_MEMBER_ROLES = ['owner', 'admin', 'member', 'viewer'] as const;\n\n/**\n * The options of the \"workspace role\" select: the default membership roles,\n * every role a member of this workspace actually holds, and the saved value\n * even when nobody holds it any more, so opening the form never drops it.\n * Roles are unique case-insensitively; the saved value's casing wins.\n */\nexport function memberRoleOptions(\n memberRoles: readonly (string | null | undefined)[],\n current: string | null | undefined\n): string[] {\n const byKey = new Map<string, string>();\n const add = (role: string | null | undefined) => {\n const trimmed = role?.trim();\n if (!trimmed) return;\n const key = trimmed.toLowerCase();\n if (!byKey.has(key)) byKey.set(key, trimmed);\n };\n DEFAULT_MEMBER_ROLES.forEach(add);\n memberRoles.forEach(add);\n add(current);\n // The saved value keeps its own casing, so the select (which matches values\n // exactly) still shows it as chosen; its position does not change.\n const saved = current?.trim();\n if (saved) byKey.set(saved.toLowerCase(), saved);\n return [...byKey.values()];\n}\n\n/** Provider name fragments that identify each channel platform's connections. */\nconst PLATFORM_PROVIDER_HINTS: Record<string, readonly string[]> = {\n SLACK: ['slack'],\n TEAMS: ['teams', 'microsoft'],\n DISCORD: ['discord'],\n WHATSAPP: ['whatsapp'],\n};\n\nexport interface LinkableConnection {\n id: string;\n status: string;\n provider: { key: string; name: string } | null;\n}\n\n/**\n * The caller's integration connections that can be linked to a channel of\n * `platform`: ACTIVE ones whose provider is that platform's.\n */\nexport function linkableConnections<T extends LinkableConnection>(\n connections: readonly T[],\n platform: string\n): T[] {\n const hints = PLATFORM_PROVIDER_HINTS[platform.toUpperCase()] ?? [platform.toLowerCase()];\n return connections.filter((connection) => {\n if (connection.status !== 'ACTIVE' || !connection.provider) return false;\n const haystack = `${connection.provider.key} ${connection.provider.name}`.toLowerCase();\n return hints.some((hint) => haystack.includes(hint));\n });\n}\n\n/** Members not yet chosen whose name or email contains the search text. */\nexport function teammateCandidates<\n T extends { userId: string; displayName: string; email?: string | null },\n>(members: readonly T[], chosen: readonly string[], query: string): T[] {\n const picked = new Set(chosen);\n const needle = query.trim().toLowerCase();\n return members.filter(\n (member) =>\n !picked.has(member.userId) &&\n (!needle ||\n member.displayName.toLowerCase().includes(needle) ||\n (member.email ?? '').toLowerCase().includes(needle))\n );\n}\n\nconst LISTBOX_MOVES: Partial<Record<string, (index: number, count: number) => number>> = {\n ArrowDown: (index, count) => (index + 1) % count,\n ArrowUp: (index, count) => (index - 1 + count) % count,\n Home: () => 0,\n End: (_index, count) => count - 1,\n};\n\n/**\n * Where a listbox key moves the highlight (wrapping at both ends), or null\n * when the key doesn't move it or the list is empty.\n */\nexport function nextListboxIndex(key: string, index: number, count: number): number | null {\n const move = LISTBOX_MOVES[key];\n return move && count > 0 ? move(Math.max(index, 0), count) : null;\n}\n"],"mappings":";;AAcA,IAAaA,IAAmB;AAMhC,SAAgBC,EAA4C,GAA4B;CACtF,IAAMC,oBAAO,IAAI,IAAY,GACvBC,IAAc,CAAC;CACrB,KAAK,IAAMC,KAAQC,GACjB,KAAK,IAAMC,KAAQF,GACjB,AAAIF,EAAK,IAAII,EAAK,EAAE,MACpBJ,EAAK,IAAII,EAAK,EAAE,GAChBH,EAAO,KAAKG,CAAI;CAGpB,OAAOH;AACT;AAGA,SAAgBI,EACd,GACA,GACU;CACV,OAAOC,EAAM,QAAQ,MAAS,CAACC,EAAM,IAAIH,EAAK,EAAE,CAAC,CAAC,CAAC,KAAK,MAASA,EAAK,EAAE;AAC1E;AAOA,SAAgBI,EAAkB,GAAyB;CACzD,OAAOC,EAAiBC,CAAK,MAAM;AACrC;AAMA,IAAaC,IAAuB;CAAC;CAAS;CAAS;CAAU;AAAQ;AAQzE,SAAgBC,EACd,GACA,GACU;CACV,IAAMC,oBAAQ,IAAI,IAAoB,GAChCC,KAAO,MAAoC;EAC/C,IAAMC,IAAUC,GAAM,KAAK;EAC3B,IAAI,CAACD,GAAS;EACd,IAAME,IAAMF,EAAQ,YAAY;EAChC,AAAKF,EAAM,IAAII,CAAG,KAAGJ,EAAM,IAAII,GAAKF,CAAO;CAC7C;CAGA,AAFAJ,EAAqB,QAAQG,CAAG,GAChCI,EAAY,QAAQJ,CAAG,GACvBA,EAAIK,CAAO;CAGX,IAAMC,IAAQD,GAAS,KAAK;CAE5B,OADIC,KAAOP,EAAM,IAAIO,EAAM,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| null | undefined;
142
142
  timezone?: string | null | undefined;
143
143
  };
144
+ /** Narrows getConnections to how the caller reaches a connection. */
145
+ export type ConnectionAccessFilter =
146
+ /** Connections the caller owns */
147
+ 'OWNED_BY_ME'
148
+ /** Connections someone else owns and shared with the caller, directly or through a group or project */
149
+ | 'SHARED_WITH_ME';
150
+ export type ConnectionFilterInput = {
151
+ /** Only connections the caller owns, or only those shared with them */
152
+ access?: ConnectionAccessFilter | null | undefined;
153
+ context?: ContextFilterInput | null | undefined;
154
+ providerCategory?: ProviderCategory | null | undefined;
155
+ providerId?: string | number | null | undefined;
156
+ search?: string | null | undefined;
157
+ status?: ConnectionStatus | null | undefined;
158
+ };
159
+ export type ConnectionStatus = 'ACTIVE' | 'ERROR' | 'EXPIRED' | 'INACTIVE' | 'PENDING_AUTH' | 'REVOKED';
144
160
  /**
145
161
  * Context filter input for querying records by context.
146
162
  * Supports exact match filtering on context fields.
@@ -525,6 +541,11 @@ export type InstalledPackageFilterInput = {
525
541
  packageId?: string | number | null | undefined;
526
542
  workspaceId: string | number;
527
543
  };
544
+ export type IntegrationsPaginationInput = {
545
+ cursor?: string | null | undefined;
546
+ limit?: number | null | undefined;
547
+ offset?: number | null | undefined;
548
+ };
528
549
  export type KnowledgeBaseFilterInput = {
529
550
  indexStatus?: IndexStatus | null | undefined;
530
551
  search?: string | null | undefined;
@@ -571,6 +592,7 @@ export type PromptTemplateFilterInput = {
571
592
  workspaceId?: string | number | null | undefined;
572
593
  };
573
594
  export type PromptVersionBump = 'MAJOR' | 'MINOR' | 'PATCH';
595
+ export type ProviderCategory = 'ACCOUNTING' | 'ANALYTICS' | 'CALENDAR' | 'CLOUD_STORAGE' | 'COMMUNICATION' | 'CRM' | 'CUSTOM' | 'DEVELOPMENT' | 'EMAIL' | 'PAYMENT' | 'PRODUCTIVITY' | 'SOCIAL';
574
596
  export type RetrievalMode = 'BM25_ONLY' | 'HYBRID' | 'VECTOR';
575
597
  export type RetrievalProfileFilterInput = {
576
598
  bucketId?: string | number | null | undefined;
@@ -2097,6 +2119,56 @@ export type BotmanorGettingStartedKnowledgeQuery = {
2097
2119
  id: string;
2098
2120
  }>;
2099
2121
  };
2122
+ export type BotmanorWorkspaceMembersQueryVariables = Exact<{
2123
+ workspaceId: string | number;
2124
+ pagination?: Types.PaginationInput | null | undefined;
2125
+ }>;
2126
+ export type BotmanorWorkspaceMembersQuery = {
2127
+ workspaceMembers: {
2128
+ hasMore: boolean;
2129
+ total: number;
2130
+ items: Array<{
2131
+ id: string;
2132
+ userId: string;
2133
+ role: string;
2134
+ status: string;
2135
+ }>;
2136
+ };
2137
+ };
2138
+ export type BotmanorWorkspaceMemberIdentitiesQueryVariables = Exact<{
2139
+ workspaceId: string | number;
2140
+ userIds: Array<string | number> | string | number;
2141
+ }>;
2142
+ export type BotmanorWorkspaceMemberIdentitiesQuery = {
2143
+ workspaceMemberIdentities: Array<{
2144
+ userId: string;
2145
+ displayName: string;
2146
+ email: string | null;
2147
+ avatar: string | null;
2148
+ }>;
2149
+ };
2150
+ export type BotmanorMyIntegrationConnectionsQueryVariables = Exact<{
2151
+ filter?: Types.ConnectionFilterInput | null | undefined;
2152
+ pagination?: Types.IntegrationsPaginationInput | null | undefined;
2153
+ }>;
2154
+ export type BotmanorMyIntegrationConnectionsQuery = {
2155
+ getConnections: {
2156
+ hasMore: boolean;
2157
+ total: number;
2158
+ items: Array<{
2159
+ id: string;
2160
+ name: string;
2161
+ status: Types.ConnectionStatus;
2162
+ externalAccountName: string | null;
2163
+ externalAccountEmail: string | null;
2164
+ provider: {
2165
+ id: string;
2166
+ key: string;
2167
+ name: string;
2168
+ };
2169
+ }>;
2170
+ };
2171
+ };
2100
2172
  export type HandoffConfigQueryVariables = Exact<{
2101
2173
  agentId: string | number;
2102
2174
  }>;
@@ -5753,6 +5825,94 @@ export type BotmanorGettingStartedKnowledgeQueryHookResult = ReturnType<typeof u
5753
5825
  export type BotmanorGettingStartedKnowledgeLazyQueryHookResult = ReturnType<typeof useBotmanorGettingStartedKnowledgeLazyQuery>;
5754
5826
  export type BotmanorGettingStartedKnowledgeSuspenseQueryHookResult = ReturnType<typeof useBotmanorGettingStartedKnowledgeSuspenseQuery>;
5755
5827
  export type BotmanorGettingStartedKnowledgeQueryResult = Apollo.QueryResult<Types.BotmanorGettingStartedKnowledgeQuery, Types.BotmanorGettingStartedKnowledgeQueryVariables>;
5828
+ export declare const BotmanorWorkspaceMembersDocument: Apollo.DocumentNode;
5829
+ /**
5830
+ * __useBotmanorWorkspaceMembersQuery__
5831
+ *
5832
+ * To run a query within a React component, call `useBotmanorWorkspaceMembersQuery` and pass it any options that fit your needs.
5833
+ * When your component renders, `useBotmanorWorkspaceMembersQuery` returns an object from Apollo Client that contains loading, error, and data properties
5834
+ * you can use to render your UI.
5835
+ *
5836
+ * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
5837
+ *
5838
+ * @example
5839
+ * const { data, loading, error } = useBotmanorWorkspaceMembersQuery({
5840
+ * variables: {
5841
+ * workspaceId: // value for 'workspaceId'
5842
+ * pagination: // value for 'pagination'
5843
+ * },
5844
+ * });
5845
+ */
5846
+ export declare function useBotmanorWorkspaceMembersQuery(baseOptions: ApolloReactHooks.QueryHookOptions<Types.BotmanorWorkspaceMembersQuery, Types.BotmanorWorkspaceMembersQueryVariables> & ({
5847
+ variables: Types.BotmanorWorkspaceMembersQueryVariables;
5848
+ skip?: boolean;
5849
+ } | {
5850
+ skip: boolean;
5851
+ })): ApolloReactHooks.useQuery.Result<Types.BotmanorWorkspaceMembersQuery, Types.BotmanorWorkspaceMembersQueryVariables, "empty" | "complete" | "streaming", Types.BotmanorWorkspaceMembersQueryVariables, undefined>;
5852
+ export declare function useBotmanorWorkspaceMembersLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<Types.BotmanorWorkspaceMembersQuery, Types.BotmanorWorkspaceMembersQueryVariables>): ApolloReactHooks.useLazyQuery.ResultTuple<Types.BotmanorWorkspaceMembersQuery, Types.BotmanorWorkspaceMembersQueryVariables, "empty" | "complete" | "streaming", undefined>;
5853
+ export declare function useBotmanorWorkspaceMembersSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions<Types.BotmanorWorkspaceMembersQuery, Types.BotmanorWorkspaceMembersQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.BotmanorWorkspaceMembersQuery, Types.BotmanorWorkspaceMembersQueryVariables>;
5854
+ export declare function useBotmanorWorkspaceMembersSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.BotmanorWorkspaceMembersQuery, Types.BotmanorWorkspaceMembersQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.BotmanorWorkspaceMembersQuery | undefined, Types.BotmanorWorkspaceMembersQueryVariables>;
5855
+ export type BotmanorWorkspaceMembersQueryHookResult = ReturnType<typeof useBotmanorWorkspaceMembersQuery>;
5856
+ export type BotmanorWorkspaceMembersLazyQueryHookResult = ReturnType<typeof useBotmanorWorkspaceMembersLazyQuery>;
5857
+ export type BotmanorWorkspaceMembersSuspenseQueryHookResult = ReturnType<typeof useBotmanorWorkspaceMembersSuspenseQuery>;
5858
+ export type BotmanorWorkspaceMembersQueryResult = Apollo.QueryResult<Types.BotmanorWorkspaceMembersQuery, Types.BotmanorWorkspaceMembersQueryVariables>;
5859
+ export declare const BotmanorWorkspaceMemberIdentitiesDocument: Apollo.DocumentNode;
5860
+ /**
5861
+ * __useBotmanorWorkspaceMemberIdentitiesQuery__
5862
+ *
5863
+ * To run a query within a React component, call `useBotmanorWorkspaceMemberIdentitiesQuery` and pass it any options that fit your needs.
5864
+ * When your component renders, `useBotmanorWorkspaceMemberIdentitiesQuery` returns an object from Apollo Client that contains loading, error, and data properties
5865
+ * you can use to render your UI.
5866
+ *
5867
+ * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
5868
+ *
5869
+ * @example
5870
+ * const { data, loading, error } = useBotmanorWorkspaceMemberIdentitiesQuery({
5871
+ * variables: {
5872
+ * workspaceId: // value for 'workspaceId'
5873
+ * userIds: // value for 'userIds'
5874
+ * },
5875
+ * });
5876
+ */
5877
+ export declare function useBotmanorWorkspaceMemberIdentitiesQuery(baseOptions: ApolloReactHooks.QueryHookOptions<Types.BotmanorWorkspaceMemberIdentitiesQuery, Types.BotmanorWorkspaceMemberIdentitiesQueryVariables> & ({
5878
+ variables: Types.BotmanorWorkspaceMemberIdentitiesQueryVariables;
5879
+ skip?: boolean;
5880
+ } | {
5881
+ skip: boolean;
5882
+ })): ApolloReactHooks.useQuery.Result<Types.BotmanorWorkspaceMemberIdentitiesQuery, Types.BotmanorWorkspaceMemberIdentitiesQueryVariables, "empty" | "complete" | "streaming", Types.BotmanorWorkspaceMemberIdentitiesQueryVariables, undefined>;
5883
+ export declare function useBotmanorWorkspaceMemberIdentitiesLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<Types.BotmanorWorkspaceMemberIdentitiesQuery, Types.BotmanorWorkspaceMemberIdentitiesQueryVariables>): ApolloReactHooks.useLazyQuery.ResultTuple<Types.BotmanorWorkspaceMemberIdentitiesQuery, Types.BotmanorWorkspaceMemberIdentitiesQueryVariables, "empty" | "complete" | "streaming", undefined>;
5884
+ export declare function useBotmanorWorkspaceMemberIdentitiesSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions<Types.BotmanorWorkspaceMemberIdentitiesQuery, Types.BotmanorWorkspaceMemberIdentitiesQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.BotmanorWorkspaceMemberIdentitiesQuery, Types.BotmanorWorkspaceMemberIdentitiesQueryVariables>;
5885
+ export declare function useBotmanorWorkspaceMemberIdentitiesSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.BotmanorWorkspaceMemberIdentitiesQuery, Types.BotmanorWorkspaceMemberIdentitiesQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.BotmanorWorkspaceMemberIdentitiesQuery | undefined, Types.BotmanorWorkspaceMemberIdentitiesQueryVariables>;
5886
+ export type BotmanorWorkspaceMemberIdentitiesQueryHookResult = ReturnType<typeof useBotmanorWorkspaceMemberIdentitiesQuery>;
5887
+ export type BotmanorWorkspaceMemberIdentitiesLazyQueryHookResult = ReturnType<typeof useBotmanorWorkspaceMemberIdentitiesLazyQuery>;
5888
+ export type BotmanorWorkspaceMemberIdentitiesSuspenseQueryHookResult = ReturnType<typeof useBotmanorWorkspaceMemberIdentitiesSuspenseQuery>;
5889
+ export type BotmanorWorkspaceMemberIdentitiesQueryResult = Apollo.QueryResult<Types.BotmanorWorkspaceMemberIdentitiesQuery, Types.BotmanorWorkspaceMemberIdentitiesQueryVariables>;
5890
+ export declare const BotmanorMyIntegrationConnectionsDocument: Apollo.DocumentNode;
5891
+ /**
5892
+ * __useBotmanorMyIntegrationConnectionsQuery__
5893
+ *
5894
+ * To run a query within a React component, call `useBotmanorMyIntegrationConnectionsQuery` and pass it any options that fit your needs.
5895
+ * When your component renders, `useBotmanorMyIntegrationConnectionsQuery` returns an object from Apollo Client that contains loading, error, and data properties
5896
+ * you can use to render your UI.
5897
+ *
5898
+ * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
5899
+ *
5900
+ * @example
5901
+ * const { data, loading, error } = useBotmanorMyIntegrationConnectionsQuery({
5902
+ * variables: {
5903
+ * filter: // value for 'filter'
5904
+ * pagination: // value for 'pagination'
5905
+ * },
5906
+ * });
5907
+ */
5908
+ export declare function useBotmanorMyIntegrationConnectionsQuery(baseOptions?: ApolloReactHooks.QueryHookOptions<Types.BotmanorMyIntegrationConnectionsQuery, Types.BotmanorMyIntegrationConnectionsQueryVariables>): ApolloReactHooks.useQuery.Result<Types.BotmanorMyIntegrationConnectionsQuery, Types.BotmanorMyIntegrationConnectionsQueryVariables, "empty" | "complete" | "streaming", Types.BotmanorMyIntegrationConnectionsQueryVariables, undefined>;
5909
+ export declare function useBotmanorMyIntegrationConnectionsLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<Types.BotmanorMyIntegrationConnectionsQuery, Types.BotmanorMyIntegrationConnectionsQueryVariables>): ApolloReactHooks.useLazyQuery.ResultTuple<Types.BotmanorMyIntegrationConnectionsQuery, Types.BotmanorMyIntegrationConnectionsQueryVariables, "empty" | "complete" | "streaming", undefined>;
5910
+ export declare function useBotmanorMyIntegrationConnectionsSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions<Types.BotmanorMyIntegrationConnectionsQuery, Types.BotmanorMyIntegrationConnectionsQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.BotmanorMyIntegrationConnectionsQuery, Types.BotmanorMyIntegrationConnectionsQueryVariables>;
5911
+ export declare function useBotmanorMyIntegrationConnectionsSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.BotmanorMyIntegrationConnectionsQuery, Types.BotmanorMyIntegrationConnectionsQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.BotmanorMyIntegrationConnectionsQuery | undefined, Types.BotmanorMyIntegrationConnectionsQueryVariables>;
5912
+ export type BotmanorMyIntegrationConnectionsQueryHookResult = ReturnType<typeof useBotmanorMyIntegrationConnectionsQuery>;
5913
+ export type BotmanorMyIntegrationConnectionsLazyQueryHookResult = ReturnType<typeof useBotmanorMyIntegrationConnectionsLazyQuery>;
5914
+ export type BotmanorMyIntegrationConnectionsSuspenseQueryHookResult = ReturnType<typeof useBotmanorMyIntegrationConnectionsSuspenseQuery>;
5915
+ export type BotmanorMyIntegrationConnectionsQueryResult = Apollo.QueryResult<Types.BotmanorMyIntegrationConnectionsQuery, Types.BotmanorMyIntegrationConnectionsQueryVariables>;
5756
5916
  export declare const HandoffConfigDocument: Apollo.DocumentNode;
5757
5917
  /**
5758
5918
  * __useHandoffConfigQuery__