wcz-layout 10.2.0 → 10.2.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.
Files changed (77) hide show
  1. package/dist/{ChatLayout-Tpuwo8-b.mjs → ChatLayout-CkS9oyPp.mjs} +597 -293
  2. package/dist/ChatLayout-CkS9oyPp.mjs.map +1 -0
  3. package/dist/{Employee-C8xIlBxY.d.mts → ExtractFile-ClTc-e1H.d.mts} +20 -3
  4. package/dist/RouterListItemButton-CF-8w-08.mjs.map +1 -1
  5. package/dist/Translate-Ad784Dps.d.mts +24 -0
  6. package/dist/{Approval-D1TfISUL.mjs → Translate-BiCjnlyx.mjs} +22 -2
  7. package/dist/Translate-BiCjnlyx.mjs.map +1 -0
  8. package/dist/ai.d.mts +36 -0
  9. package/dist/ai.mjs +168 -0
  10. package/dist/ai.mjs.map +1 -0
  11. package/dist/auth.d.mts +4 -3
  12. package/dist/auth.mjs +5 -4
  13. package/dist/auth.mjs.map +1 -1
  14. package/dist/authMiddleware-D4GSt7m9.mjs +50 -0
  15. package/dist/authMiddleware-D4GSt7m9.mjs.map +1 -0
  16. package/dist/components.mjs +55 -45
  17. package/dist/components.mjs.map +1 -1
  18. package/dist/{createApi-CKgFi53y.mjs → createApi-CF4ZL82B.mjs} +3 -4
  19. package/dist/createApi-CF4ZL82B.mjs.map +1 -0
  20. package/dist/data/client.d.mts +17 -1
  21. package/dist/data/client.mjs +11 -5
  22. package/dist/data/client.mjs.map +1 -1
  23. package/dist/data/server.d.mts +18 -3
  24. package/dist/data/server.mjs +5 -5
  25. package/dist/{env-BwFl7nWc.mjs → env-Cddts_dn.mjs} +2 -1
  26. package/dist/env-Cddts_dn.mjs.map +1 -0
  27. package/dist/{file-X1sK4ok6.mjs → file-D4kSR_lC.mjs} +5 -6
  28. package/dist/file-D4kSR_lC.mjs.map +1 -0
  29. package/dist/{file-tkfsnk5F.mjs → file-DcwYjofa.mjs} +6 -7
  30. package/dist/file-DcwYjofa.mjs.map +1 -0
  31. package/dist/generatedChart-k7NEdi5Z.mjs.map +1 -1
  32. package/dist/hooks.d.mts +2 -2
  33. package/dist/hooks.mjs +296 -194
  34. package/dist/hooks.mjs.map +1 -1
  35. package/dist/index.mjs +224 -173
  36. package/dist/index.mjs.map +1 -1
  37. package/dist/{approval-HB2w5jzc.mjs → layout-6We_KFgN.mjs} +28 -4
  38. package/dist/layout-6We_KFgN.mjs.map +1 -0
  39. package/dist/middleware.mjs +1 -45
  40. package/dist/middleware.mjs.map +1 -1
  41. package/dist/models.d.mts +3 -3
  42. package/dist/models.mjs +2 -2
  43. package/dist/{peoplesoft-RnvfLbWH.mjs → peoplesoft-DH31FCMC.mjs} +3 -3
  44. package/dist/{peoplesoft-RnvfLbWH.mjs.map → peoplesoft-DH31FCMC.mjs.map} +1 -1
  45. package/dist/{peoplesoft-C-zPdRVj.d.mts → peoplesoft-DXukeeFr.d.mts} +2 -2
  46. package/dist/{providers-BfFg_3eo.mjs → providers-DOFje2P6.mjs} +7 -7
  47. package/dist/providers-DOFje2P6.mjs.map +1 -0
  48. package/dist/{tokens-C4SErO-K.mjs → tokens-DNe_Qifk.mjs} +63 -9
  49. package/dist/tokens-DNe_Qifk.mjs.map +1 -0
  50. package/dist/user-Bc2nLjAG.mjs +136 -0
  51. package/dist/user-Bc2nLjAG.mjs.map +1 -0
  52. package/dist/utils-CgabUlDD.mjs +131 -0
  53. package/dist/utils-CgabUlDD.mjs.map +1 -0
  54. package/dist/utils.d.mts +1 -10
  55. package/dist/utils.mjs +5 -3
  56. package/package.json +45 -14
  57. package/skills/ai/SKILL.md +108 -75
  58. package/skills/general/references/auth.md +7 -3
  59. package/skills/migrations/versions/migrate-v10-to-v11.md +4 -0
  60. package/skills/services/SKILL.md +41 -7
  61. package/skills/services/docs/approval.md +5 -0
  62. package/skills/services/docs/layout.md +130 -0
  63. package/skills/start/steps/03-apm-setup.md +8 -1
  64. package/dist/Approval-D1TfISUL.mjs.map +0 -1
  65. package/dist/ChatLayout-Tpuwo8-b.mjs.map +0 -1
  66. package/dist/Email-Dz5k0UWE.d.mts +0 -15
  67. package/dist/approval-HB2w5jzc.mjs.map +0 -1
  68. package/dist/createApi-CKgFi53y.mjs.map +0 -1
  69. package/dist/env-BwFl7nWc.mjs.map +0 -1
  70. package/dist/file-X1sK4ok6.mjs.map +0 -1
  71. package/dist/file-tkfsnk5F.mjs.map +0 -1
  72. package/dist/providers-BfFg_3eo.mjs.map +0 -1
  73. package/dist/tokens-C4SErO-K.mjs.map +0 -1
  74. package/dist/utils-C2MZoH9U.mjs +0 -263
  75. package/dist/utils-C2MZoH9U.mjs.map +0 -1
  76. package/dist/utils-DnMFybj3.mjs +0 -27
  77. package/dist/utils-DnMFybj3.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatLayout-CkS9oyPp.mjs","names":["{ open, payload, onClose }: Readonly<AlertDialogProps>","() => onClose()","payload.title ?? t(\"Layout.Dialog.Alert\")","title","<DialogTitle>{payload.title ?? t(\"Layout.Dialog.Alert\")}</DialogTitle>","<DialogContent id={messageId}>{payload.message}</DialogContent>","message","t(\"Layout.Dialog.Confirm\")","<DialogActions>\n <Button onClick={() => onClose()} autoFocus>\n {t(\"Layout.Dialog.Confirm\")}\n </Button>\n </DialogActions>","<Dialog\n maxWidth=\"xs\"\n fullWidth\n open={open}\n onClose={() => onClose()}\n role=\"alertdialog\"\n aria-describedby={messageId}\n >\n <DialogTitle>{payload.title ?? t(\"Layout.Dialog.Alert\")}</DialogTitle>\n <DialogContent id={messageId}>{payload.message}</DialogContent>\n <DialogActions>\n <Button onClick={() => onClose()} autoFocus>\n {t(\"Layout.Dialog.Confirm\")}\n </Button>\n </DialogActions>\n </Dialog>","{ open, payload, onClose }: Readonly<ConfirmDialogProps>","() => onClose(false)","payload.title ?? t(\"Layout.Dialog.Confirm\")","<DialogTitle>{payload.title ?? t(\"Layout.Dialog.Confirm\")}</DialogTitle>","payload.cancelText ?? t(\"Layout.Dialog.Cancel\")","cancelText","<Button onClick={() => onClose(false)}>\n {payload.cancelText ?? t(\"Layout.Dialog.Cancel\")}\n </Button>","() => onClose(true)","payload.confirmText ?? t(\"Layout.Dialog.Confirm\")","confirmText","<Button onClick={() => onClose(true)} autoFocus>\n {payload.confirmText ?? t(\"Layout.Dialog.Confirm\")}\n </Button>","<DialogActions>\n <Button onClick={() => onClose(false)}>\n {payload.cancelText ?? t(\"Layout.Dialog.Cancel\")}\n </Button>\n <Button onClick={() => onClose(true)} autoFocus>\n {payload.confirmText ?? t(\"Layout.Dialog.Confirm\")}\n </Button>\n </DialogActions>","<Dialog\n maxWidth=\"xs\"\n fullWidth\n open={open}\n onClose={() => onClose(false)}\n role=\"alertdialog\"\n aria-describedby={messageId}\n >\n <DialogTitle>{payload.title ?? t(\"Layout.Dialog.Confirm\")}</DialogTitle>\n <DialogContent id={messageId}>{payload.message}</DialogContent>\n <DialogActions>\n <Button onClick={() => onClose(false)}>\n {payload.cancelText ?? t(\"Layout.Dialog.Cancel\")}\n </Button>\n <Button onClick={() => onClose(true)} autoFocus>\n {payload.confirmText ?? t(\"Layout.Dialog.Confirm\")}\n </Button>\n </DialogActions>\n </Dialog>","(message, { ...options } = {}) =>\n open(AlertDialog, { ...options, message })","{ ...options } = {}","(message, { ...options } = {}) =>\n open(ConfirmDialog, { ...options, message })","options","{ alert, confirm, open, close }","<Link ref={reference} {...props} />","<CreatedComponent {...props} />","prefix = \"\"","{ prefix = \"\", options, dateFormat, ...props }","Typography","\"body2\"","\"text.secondary\"","noWrap","props","prefix","Array.isArray(value) ? value.map(format).join(\" – \") : format(value)","(entry: unknown) =>\n typeof entry === \"number\"\n ? entry.toLocaleString(undefined, options)\n : formatValue(entry, dateFormat)","<Typography variant=\"body2\" color=\"text.secondary\" noWrap {...props}>\n {prefix}\n {/* `extent` — the default aggregate for anything non-numeric — is a [min, max] pair. */}\n {Array.isArray(value) ? value.map(format).join(\" – \") : format(value)}\n </Typography>","z","{ node }: Readonly<{ node: Record<string, unknown> }>","isRecord(node.props) ? node.props : {}","props","<Skeleton variant=\"rounded\" height={typeof height === \"number\" ? height : 280} />","typeof height === \"number\" ? height : 280","streaming ? (\n placeholder\n ) : (\n <Suspense fallback={placeholder}>\n <GeneratedChart node={node} />\n </Suspense>\n )","{ part }: Readonly<{ part: ToolCallPart }>","part.input ?? (parsePartialJSON(part.arguments) as unknown)","arguments","input","{ overflowX: \"auto\", m: -0.5, p: 0.5 }","() => part.arguments","() => <Alert severity=\"warning\">{t(\"Layout.Chat.RenderFailed\")}</Alert>","renderGeneratedUi(input?.ui)","input?.ui","<Streaming value={part.input === undefined}>{renderGeneratedUi(input?.ui)}</Streaming>","part.input === undefined","<Box sx={{ overflowX: \"auto\", m: -0.5, p: 0.5 }}>\n <CatchBoundary\n getResetKey={() => part.arguments}\n errorComponent={() => <Alert severity=\"warning\">{t(\"Layout.Chat.RenderFailed\")}</Alert>}\n >\n <Streaming value={part.input === undefined}>{renderGeneratedUi(input?.ui)}</Streaming>\n </CatchBoundary>\n </Box>","{\n part,\n disabled,\n onAnswer,\n}: Readonly<{\n part: ToolCallPart;\n disabled: boolean;\n onAnswer: (values: Record<string, unknown>) => void;\n}>","(event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n const { submitter } = event.nativeEvent as SubmitEvent;\n const values: Record<string, unknown> = {};\n for (const [name, value] of new FormData(event.currentTarget, submitter)) {\n const previous = values[name];\n values[name] = previous === undefined ? value : [previous, value].flat();\n }\n onAnswer(values);\n }","{\n border: 0,\n m: 0,\n p: 0,\n minWidth: 0,\n opacity: answer === undefined ? 1 : 0.6,\n pointerEvents: disabled ? \"none\" : undefined,\n }","answer === undefined ? 1 : 0.6","disabled ? \"none\" : undefined","<GeneratedUi part={part} />","<Box\n component=\"fieldset\"\n disabled={disabled}\n sx={{\n border: 0,\n m: 0,\n p: 0,\n minWidth: 0,\n opacity: answer === undefined ? 1 : 0.6,\n pointerEvents: disabled ? \"none\" : undefined,\n }}\n >\n <GeneratedUi part={part} />\n </Box>","isRecord(answer) && (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {Object.entries(answer)\n .map(([name, value]) => `${name}: ${String(value)}`)\n .join(\", \")}\n </Typography>\n )","([name, value]) => `${name}: ${String(value)}`","<Box component=\"form\" onSubmit={submit}>\n <Box\n component=\"fieldset\"\n disabled={disabled}\n sx={{\n border: 0,\n m: 0,\n p: 0,\n minWidth: 0,\n opacity: answer === undefined ? 1 : 0.6,\n pointerEvents: disabled ? \"none\" : undefined,\n }}\n >\n <GeneratedUi part={part} />\n </Box>\n {isRecord(answer) && (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {Object.entries(answer)\n .map(([name, value]) => `${name}: ${String(value)}`)\n .join(\", \")}\n </Typography>\n )}\n </Box>","name","value","[name, value]","_temp","{ href = \"\", children }: ComponentPropsWithoutRef<\"a\">","href = \"\"","href.startsWith(\"/\") && !href.startsWith(\"//\") ? (\n <RouterLink to={href}>{children}</RouterLink>\n ) : (\n <Link href={href} target=\"_blank\" rel=\"noreferrer\">\n {children}\n </Link>\n )","() => {\n const scroller = ref.current;\n if (!scroller) return;\n let previousTop = scroller.scrollTop;\n\n const onScroll = () => {\n following.current = keepsFollowing(following.current, previousTop, scroller);\n previousTop = scroller.scrollTop;\n };\n const observer = new ResizeObserver(() => {\n if (!following.current) return;\n scroller.scrollTop = scroller.scrollHeight;\n previousTop = scroller.scrollTop;\n });\n\n scroller.addEventListener(\"scroll\", onScroll, { passive: true });\n observer.observe(scroller);\n for (const child of scroller.children) observer.observe(child);\n return () => {\n scroller.removeEventListener(\"scroll\", onScroll);\n observer.disconnect();\n };\n }","[]","{ ref, following }","t(\"Layout.Chat.Reasoning\")","<Typography className={statusClass} sx={shimmerSx}>\n {t(\"Layout.Chat.Reasoning\")}\n </Typography>","{ part, live }: Readonly<{ part: ToolCallPart; live: boolean }>","running ? shimmerSx : { color: \"text.secondary\" }","activityText(t, part, live)","<Typography\n variant=\"body2\"\n className={statusClass}\n sx={running ? shimmerSx : { color: \"text.secondary\" }}\n >\n {activityText(t, part, live)}\n </Typography>","{\n message,\n live,\n canAnswer,\n addToolResult,\n}: Readonly<{\n message: UIMessage;\n live: boolean;\n canAnswer: boolean;\n addToolResult: Chat[\"addToolResult\"];\n}>","<Stack spacing={1} sx={{ alignSelf: \"flex-end\", alignItems: \"flex-end\", maxWidth: \"80%\" }}>\n {files.length > 0 && (\n <Stack direction=\"row\" sx={{ flexWrap: \"wrap\", justifyContent: \"flex-end\", gap: 0.5 }}>\n {files.map((part, index) =>\n part.type === \"image\" ? (\n <Box\n key={index}\n component=\"img\"\n src={srcOf(part)}\n alt=\"Attached image\"\n sx={{ maxWidth: \"100%\", maxHeight: 160, borderRadius: 3 }}\n />\n ) : (\n <Chip key={index} variant=\"outlined\" label={fileNameOf(part)} />\n ),\n )}\n </Stack>\n )}\n {typed.length > 0 && (\n <Typography\n sx={{\n px: 2,\n py: 1.25,\n borderRadius: 4.5,\n bgcolor: \"action.hover\",\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n }}\n >\n {typed.join(\"\\n\")}\n </Typography>\n )}\n </Stack>","parts","(part) => (part.type === \"text\" ? [part.content] : [])","({ type }) => type === \"image\" || type === \"document\"","{ alignSelf: \"flex-end\", alignItems: \"flex-end\", maxWidth: \"80%\" }","(part, index) =>\n part.type === \"image\" ? (\n <Box\n key={index}\n component=\"img\"\n src={srcOf(part)}\n alt=\"Attached image\"\n sx={{ maxWidth: \"100%\", maxHeight: 160, borderRadius: 3 }}\n />\n ) : (\n <Chip key={index} variant=\"outlined\" label={fileNameOf(part)} />\n )","message.parts.map((part, index) => {\n if (part.type === \"text\")\n return part.content ? (\n <Box key={index} sx={markdownSx}>\n <Markdown extensions={markdownExtensions} components={markdownComponents}>\n {part.content}\n </Markdown>\n </Box>\n ) : null;\n if (part.type !== \"tool-call\") return null;\n const ui = part.name === \"show_ui\" || part.name === \"ask_user\";\n // The model draws a UI whose input failed again.\n if (ui && part.state === \"error\") return null;\n if (part.name === \"show_ui\") return <GeneratedUi key={part.id} part={part} />;\n if (part.name === \"ask_user\")\n return (\n <AskUser\n key={part.id}\n part={part}\n disabled={!canAnswer || part.output !== undefined}\n onAnswer={(output) =>\n void addToolResult({ toolCallId: part.id, tool: part.name, output })\n }\n />\n );\n return <ToolActivity key={part.id} part={part} live={live} />;\n })","(part, index) => {\n if (part.type === \"text\")\n return part.content ? (\n <Box key={index} sx={markdownSx}>\n <Markdown extensions={markdownExtensions} components={markdownComponents}>\n {part.content}\n </Markdown>\n </Box>\n ) : null;\n if (part.type !== \"tool-call\") return null;\n const ui = part.name === \"show_ui\" || part.name === \"ask_user\";\n // The model draws a UI whose input failed again.\n if (ui && part.state === \"error\") return null;\n if (part.name === \"show_ui\") return <GeneratedUi key={part.id} part={part} />;\n if (part.name === \"ask_user\")\n return (\n <AskUser\n key={part.id}\n part={part}\n disabled={!canAnswer || part.output !== undefined}\n onAnswer={(output) =>\n void addToolResult({ toolCallId: part.id, tool: part.name, output })\n }\n />\n );\n return <ToolActivity key={part.id} part={part} live={live} />;\n }","part","index","{ type }","{ chat }: Readonly<{ chat: Chat }>","chat.interrupts.map((interrupt) =>\n interrupt.metadata?.kind === \"approval\" &&\n interrupt.status === \"pending\" &&\n \"resolveInterrupt\" in interrupt ? (\n <Alert\n key={interrupt.id}\n severity=\"warning\"\n action={\n <Stack direction=\"row\" spacing={1}>\n <Button\n color=\"inherit\"\n size=\"small\"\n disabled={chat.resuming}\n onClick={() => interrupt.resolveInterrupt(false)}\n >\n {t(\"Layout.Dialog.Cancel\")}\n </Button>\n <Button\n color=\"inherit\"\n size=\"small\"\n disabled={chat.resuming}\n onClick={() => interrupt.resolveInterrupt(true)}\n >\n {t(\"Layout.Dialog.Confirm\")}\n </Button>\n </Stack>\n }\n >\n {t(\"Layout.Chat.AreYouSure\")}\n </Alert>\n ) : null,\n )","interrupts","resuming","(interrupt) =>\n interrupt.metadata?.kind === \"approval\" &&\n interrupt.status === \"pending\" &&\n \"resolveInterrupt\" in interrupt ? (\n <Alert\n key={interrupt.id}\n severity=\"warning\"\n action={\n <Stack direction=\"row\" spacing={1}>\n <Button\n color=\"inherit\"\n size=\"small\"\n disabled={chat.resuming}\n onClick={() => interrupt.resolveInterrupt(false)}\n >\n {t(\"Layout.Dialog.Cancel\")}\n </Button>\n <Button\n color=\"inherit\"\n size=\"small\"\n disabled={chat.resuming}\n onClick={() => interrupt.resolveInterrupt(true)}\n >\n {t(\"Layout.Dialog.Confirm\")}\n </Button>\n </Stack>\n }\n >\n {t(\"Layout.Chat.AreYouSure\")}\n </Alert>\n ) : null","{ chat, files, setFiles, pick, onSend }: Readonly<ChatInputProps>","draft.trim() !== \"\" || files.length > 0","length","(event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (!ready) return;\n onSend();\n const parts = files.map(({ part }) => part);\n if (draft.trim()) parts.push({ type: \"text\", content: draft.trim() });\n void chat.sendMessage(files.length ? { content: parts } : draft.trim());\n setDraft(\"\");\n setFiles([]);\n }","({ part }) => part","(event: KeyboardEvent<HTMLFormElement>) => {\n if (event.key !== \"Enter\" || event.shiftKey || event.nativeEvent.isComposing) return;\n if (!(event.target instanceof HTMLTextAreaElement)) return;\n event.preventDefault();\n event.currentTarget.requestSubmit();\n }","async () => {\n if (await confirm(t(\"Layout.Chat.NewChatConfirm\"))) chat.clear();\n }","chat.queue.map(({ id, content }) => (\n <Chip\n key={id}\n variant=\"outlined\"\n label={queuedText(content)}\n onDelete={() => chat.cancelQueued(id)}\n sx={{ alignSelf: \"flex-end\", maxWidth: \"80%\" }}\n />\n ))","{ id, content }","{ p: 1, borderRadius: 7, boxShadow: 2 }","files.length > 0 && (\n <Stack direction=\"row\" sx={{ flexWrap: \"wrap\", gap: 0.5, px: 1, pb: 1 }}>\n {files.map(({ name, part }, index) => (\n <Chip\n key={index}\n size=\"small\"\n label={name}\n avatar={\n part.type === \"image\" ? (\n <Avatar variant=\"rounded\" src={srcOf(part)} alt=\"\" />\n ) : undefined\n }\n onDelete={() => setFiles(files.filter((_, at) => at !== index))}\n />\n ))}\n </Stack>\n )","{ name, part }","files.length","{ alignItems: \"flex-end\" }","t(\"Layout.Chat.NewChat\")","() => void newChat()","<Add />","<span>\n <IconButton\n aria-label=\"New chat\"\n onClick={() => void newChat()}\n disabled={!chat.messages.length}\n >\n <Add />\n </IconButton>\n </span>","!chat.messages.length","<Tooltip title={t(\"Layout.Chat.NewChat\")}>\n <span>\n <IconButton\n aria-label=\"New chat\"\n onClick={() => void newChat()}\n disabled={!chat.messages.length}\n >\n <Add />\n </IconButton>\n </span>\n </Tooltip>","t(\"Layout.Chat.Attach\")","<AttachFile />","<IconButton aria-label=\"Attach files\" onClick={pick}>\n <AttachFile />\n </IconButton>","<Tooltip title={t(\"Layout.Chat.Attach\")}>\n <IconButton aria-label=\"Attach files\" onClick={pick}>\n <AttachFile />\n </IconButton>\n </Tooltip>","(event) => setDraft(event.target.value)","event","t(\"Layout.Chat.Message\")","{ input: { \"aria-label\": \"Ask anything\" } }","{ flex: 1, py: 1, pl: 0.5 }","<InputBase\n value={draft}\n onChange={(event) => setDraft(event.target.value)}\n placeholder={t(\"Layout.Chat.Message\")}\n multiline\n maxRows={8}\n slotProps={{ input: { \"aria-label\": \"Ask anything\" } }}\n sx={{ flex: 1, py: 1, pl: 0.5 }}\n />","chat.isLoading && (\n <Tooltip title={t(\"Layout.Chat.Stop\")}>\n <IconButton aria-label=\"Stop\" onClick={chat.stop} sx={roundButtonSx}>\n <Stop />\n </IconButton>\n </Tooltip>\n )","isLoading","stop","(!chat.isLoading || ready) && (\n <Tooltip title={t(\"Layout.Chat.Send\")}>\n <IconButton aria-label=\"Send\" type=\"submit\" sx={roundButtonSx}>\n <ArrowUpward />\n </IconButton>\n </Tooltip>\n )","<Stack direction=\"row\" spacing={0.5} sx={{ alignItems: \"flex-end\" }}>\n <Tooltip title={t(\"Layout.Chat.NewChat\")}>\n <span>\n <IconButton\n aria-label=\"New chat\"\n onClick={() => void newChat()}\n disabled={!chat.messages.length}\n >\n <Add />\n </IconButton>\n </span>\n </Tooltip>\n <Tooltip title={t(\"Layout.Chat.Attach\")}>\n <IconButton aria-label=\"Attach files\" onClick={pick}>\n <AttachFile />\n </IconButton>\n </Tooltip>\n <InputBase\n value={draft}\n onChange={(event) => setDraft(event.target.value)}\n placeholder={t(\"Layout.Chat.Message\")}\n multiline\n maxRows={8}\n slotProps={{ input: { \"aria-label\": \"Ask anything\" } }}\n sx={{ flex: 1, py: 1, pl: 0.5 }}\n />\n {chat.isLoading && (\n <Tooltip title={t(\"Layout.Chat.Stop\")}>\n <IconButton aria-label=\"Stop\" onClick={chat.stop} sx={roundButtonSx}>\n <Stop />\n </IconButton>\n </Tooltip>\n )}\n {(!chat.isLoading || ready) && (\n <Tooltip title={t(\"Layout.Chat.Send\")}>\n <IconButton aria-label=\"Send\" type=\"submit\" sx={roundButtonSx}>\n <ArrowUpward />\n </IconButton>\n </Tooltip>\n )}\n </Stack>","<Paper\n component=\"form\"\n variant=\"outlined\"\n onSubmit={send}\n onKeyDown={sendOnEnter}\n sx={{ p: 1, borderRadius: 7, boxShadow: 2 }}\n >\n {files.length > 0 && (\n <Stack direction=\"row\" sx={{ flexWrap: \"wrap\", gap: 0.5, px: 1, pb: 1 }}>\n {files.map(({ name, part }, index) => (\n <Chip\n key={index}\n size=\"small\"\n label={name}\n avatar={\n part.type === \"image\" ? (\n <Avatar variant=\"rounded\" src={srcOf(part)} alt=\"\" />\n ) : undefined\n }\n onDelete={() => setFiles(files.filter((_, at) => at !== index))}\n />\n ))}\n </Stack>\n )}\n <Stack direction=\"row\" spacing={0.5} sx={{ alignItems: \"flex-end\" }}>\n <Tooltip title={t(\"Layout.Chat.NewChat\")}>\n <span>\n <IconButton\n aria-label=\"New chat\"\n onClick={() => void newChat()}\n disabled={!chat.messages.length}\n >\n <Add />\n </IconButton>\n </span>\n </Tooltip>\n <Tooltip title={t(\"Layout.Chat.Attach\")}>\n <IconButton aria-label=\"Attach files\" onClick={pick}>\n <AttachFile />\n </IconButton>\n </Tooltip>\n <InputBase\n value={draft}\n onChange={(event) => setDraft(event.target.value)}\n placeholder={t(\"Layout.Chat.Message\")}\n multiline\n maxRows={8}\n slotProps={{ input: { \"aria-label\": \"Ask anything\" } }}\n sx={{ flex: 1, py: 1, pl: 0.5 }}\n />\n {chat.isLoading && (\n <Tooltip title={t(\"Layout.Chat.Stop\")}>\n <IconButton aria-label=\"Stop\" onClick={chat.stop} sx={roundButtonSx}>\n <Stop />\n </IconButton>\n </Tooltip>\n )}\n {(!chat.isLoading || ready) && (\n <Tooltip title={t(\"Layout.Chat.Send\")}>\n <IconButton aria-label=\"Send\" type=\"submit\" sx={roundButtonSx}>\n <ArrowUpward />\n </IconButton>\n </Tooltip>\n )}\n </Stack>\n </Paper>","<Stack spacing={1}>\n {chat.queue.map(({ id, content }) => (\n <Chip\n key={id}\n variant=\"outlined\"\n label={queuedText(content)}\n onDelete={() => chat.cancelQueued(id)}\n sx={{ alignSelf: \"flex-end\", maxWidth: \"80%\" }}\n />\n ))}\n <Paper\n component=\"form\"\n variant=\"outlined\"\n onSubmit={send}\n onKeyDown={sendOnEnter}\n sx={{ p: 1, borderRadius: 7, boxShadow: 2 }}\n >\n {files.length > 0 && (\n <Stack direction=\"row\" sx={{ flexWrap: \"wrap\", gap: 0.5, px: 1, pb: 1 }}>\n {files.map(({ name, part }, index) => (\n <Chip\n key={index}\n size=\"small\"\n label={name}\n avatar={\n part.type === \"image\" ? (\n <Avatar variant=\"rounded\" src={srcOf(part)} alt=\"\" />\n ) : undefined\n }\n onDelete={() => setFiles(files.filter((_, at) => at !== index))}\n />\n ))}\n </Stack>\n )}\n <Stack direction=\"row\" spacing={0.5} sx={{ alignItems: \"flex-end\" }}>\n <Tooltip title={t(\"Layout.Chat.NewChat\")}>\n <span>\n <IconButton\n aria-label=\"New chat\"\n onClick={() => void newChat()}\n disabled={!chat.messages.length}\n >\n <Add />\n </IconButton>\n </span>\n </Tooltip>\n <Tooltip title={t(\"Layout.Chat.Attach\")}>\n <IconButton aria-label=\"Attach files\" onClick={pick}>\n <AttachFile />\n </IconButton>\n </Tooltip>\n <InputBase\n value={draft}\n onChange={(event) => setDraft(event.target.value)}\n placeholder={t(\"Layout.Chat.Message\")}\n multiline\n maxRows={8}\n slotProps={{ input: { \"aria-label\": \"Ask anything\" } }}\n sx={{ flex: 1, py: 1, pl: 0.5 }}\n />\n {chat.isLoading && (\n <Tooltip title={t(\"Layout.Chat.Stop\")}>\n <IconButton aria-label=\"Stop\" onClick={chat.stop} sx={roundButtonSx}>\n <Stop />\n </IconButton>\n </Tooltip>\n )}\n {(!chat.isLoading || ready) && (\n <Tooltip title={t(\"Layout.Chat.Send\")}>\n <IconButton aria-label=\"Send\" type=\"submit\" sx={roundButtonSx}>\n <ArrowUpward />\n </IconButton>\n </Tooltip>\n )}\n </Stack>\n </Paper>\n </Stack>","{ part }"],"sources":["../src/hooks/useDialogs.tsx","../src/components/router/RouterLink.tsx","../src/components/table/context.ts","../src/components/table/table/Pagination.tsx","../src/components/table/utils.ts","../src/components/table/formatValue.ts","../src/components/table/cells/formatters/AggregatedCell.tsx","../src/lib/ai/tools/ui.ts","../src/components/chat/generatedUi.tsx","../src/lib/ai/attachments.ts","../src/components/chat/ChatLayout.tsx"],"sourcesContent":["import {\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n useEventCallback,\n} from \"@mui/material\";\nimport { useContext, useId } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { DialogsContext } from \"../contexts/DialogsContext\";\nimport type { ReactNode } from \"react\";\n\nexport interface OpenDialogOptions<TResult> {\n onClose?: (result: TResult) => Promise<void>;\n}\n\nexport interface AlertOptions {\n title?: ReactNode;\n}\n\nexport interface ConfirmOptions {\n title?: ReactNode;\n confirmText?: ReactNode;\n cancelText?: ReactNode;\n}\n\nexport interface DialogProps<TPayload = undefined, TResult = void> {\n payload: TPayload;\n open: boolean;\n onClose: (result: TResult) => Promise<void>;\n}\n\nexport type OpenAlertDialog = (message: ReactNode, options?: AlertOptions) => Promise<void>;\n\nexport type OpenConfirmDialog = (message: ReactNode, options?: ConfirmOptions) => Promise<boolean>;\n\nexport type DialogComponent<TPayload, TResult> = React.ComponentType<\n DialogProps<TPayload, TResult>\n>;\n\nexport interface OpenDialog {\n <TPayload extends undefined, TResult>(\n Component: DialogComponent<TPayload, TResult>,\n payload?: TPayload,\n options?: OpenDialogOptions<TResult>,\n ): Promise<TResult>;\n <TPayload, TResult>(\n Component: DialogComponent<TPayload, TResult>,\n payload: TPayload,\n options?: OpenDialogOptions<TResult>,\n ): Promise<TResult>;\n}\n\nexport type CloseDialog = <TResult>(dialog: Promise<TResult>, result: TResult) => Promise<TResult>;\n\nexport interface AlertDialogPayload extends AlertOptions {\n message: ReactNode;\n}\n\nexport type AlertDialogProps = DialogProps<AlertDialogPayload, void>;\n\nexport function AlertDialog({ open, payload, onClose }: Readonly<AlertDialogProps>) {\n const { t } = useTranslation();\n const messageId = useId();\n\n return (\n <Dialog\n maxWidth=\"xs\"\n fullWidth\n open={open}\n onClose={() => onClose()}\n role=\"alertdialog\"\n aria-describedby={messageId}\n >\n <DialogTitle>{payload.title ?? t(\"Layout.Dialog.Alert\")}</DialogTitle>\n <DialogContent id={messageId}>{payload.message}</DialogContent>\n <DialogActions>\n <Button onClick={() => onClose()} autoFocus>\n {t(\"Layout.Dialog.Confirm\")}\n </Button>\n </DialogActions>\n </Dialog>\n );\n}\n\nexport interface ConfirmDialogPayload extends ConfirmOptions {\n message: ReactNode;\n}\n\nexport type ConfirmDialogProps = DialogProps<ConfirmDialogPayload, boolean>;\n\nexport function ConfirmDialog({ open, payload, onClose }: Readonly<ConfirmDialogProps>) {\n const { t } = useTranslation();\n const messageId = useId();\n\n return (\n <Dialog\n maxWidth=\"xs\"\n fullWidth\n open={open}\n onClose={() => onClose(false)}\n role=\"alertdialog\"\n aria-describedby={messageId}\n >\n <DialogTitle>{payload.title ?? t(\"Layout.Dialog.Confirm\")}</DialogTitle>\n <DialogContent id={messageId}>{payload.message}</DialogContent>\n <DialogActions>\n <Button onClick={() => onClose(false)}>\n {payload.cancelText ?? t(\"Layout.Dialog.Cancel\")}\n </Button>\n <Button onClick={() => onClose(true)} autoFocus>\n {payload.confirmText ?? t(\"Layout.Dialog.Confirm\")}\n </Button>\n </DialogActions>\n </Dialog>\n );\n}\n\ninterface DialogHook {\n alert: OpenAlertDialog;\n confirm: OpenConfirmDialog;\n open: OpenDialog;\n close: CloseDialog;\n}\n\nexport function useDialogs(): DialogHook {\n const { open, close } = useContext(DialogsContext);\n\n const alert = useEventCallback<OpenAlertDialog>((message, { ...options } = {}) =>\n open(AlertDialog, { ...options, message }),\n );\n\n const confirm = useEventCallback<OpenConfirmDialog>((message, { ...options } = {}) =>\n open(ConfirmDialog, { ...options, message }),\n );\n\n return { alert, confirm, open, close };\n}\n","import { Link } from \"@mui/material\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { LinkProps } from \"@mui/material\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLAnchorElement, LinkProps>(\n function LinkComponent(props, reference) {\n return <Link ref={reference} {...props} />;\n },\n);\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterLink: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};\n","import {\n aggregationFn_count,\n aggregationFn_extent,\n aggregationFn_first,\n aggregationFn_last,\n aggregationFn_max,\n aggregationFn_mean,\n aggregationFn_median,\n aggregationFn_min,\n aggregationFn_sum,\n aggregationFn_unique,\n aggregationFn_uniqueCount,\n createExpandedRowModel,\n createFacetedMinMaxValues,\n createFacetedRowModel,\n createFacetedUniqueValues,\n createFilteredRowModel,\n createGroupedRowModel,\n createPaginatedRowModel,\n createSortedRowModel,\n createTableHookContexts,\n filterFn_arrHas,\n filterFn_arrIncludes,\n filterFn_arrIncludesAll,\n filterFn_arrIncludesSome,\n filterFn_between,\n filterFn_betweenInclusive,\n filterFn_empty,\n filterFn_endsWith,\n filterFn_equals,\n filterFn_equalsString,\n filterFn_equalsStringSensitive,\n filterFn_greaterThan,\n filterFn_greaterThanOrEqualTo,\n filterFn_inDateRange,\n filterFn_inNumberRange,\n filterFn_includesString,\n filterFn_includesStringSensitive,\n filterFn_lessThan,\n filterFn_lessThanOrEqualTo,\n filterFn_notEmpty,\n filterFn_startsWith,\n filterFn_weakEquals,\n metaHelper,\n sortFn_alphanumeric,\n sortFn_alphanumericCaseSensitive,\n sortFn_basic,\n sortFn_datetime,\n sortFn_text,\n sortFn_textCaseSensitive,\n stockFeatures,\n tableFeatures,\n} from \"@tanstack/react-table\";\nimport type { AggregationFnDef } from \"@tanstack/react-table\";\nimport type { LayoutColumnMeta } from \"~/components/table/types\";\n\n// table-core types min/max/extent with its non-exported `RangeValue`, which breaks .d.ts emit.\ntype RangeValue = Date | number | undefined;\ntype WithResult<TFn, TResult> =\n TFn extends AggregationFnDef<infer TFeatures, infer TData, infer TValue, unknown>\n ? AggregationFnDef<TFeatures, TData, TValue, TResult>\n : never;\n\nexport const layoutTableFeatures = tableFeatures({\n ...stockFeatures,\n columnMeta: metaHelper<LayoutColumnMeta>(),\n filteredRowModel: createFilteredRowModel(),\n sortedRowModel: createSortedRowModel(),\n paginatedRowModel: createPaginatedRowModel(),\n expandedRowModel: createExpandedRowModel(),\n groupedRowModel: createGroupedRowModel(),\n facetedRowModel: createFacetedRowModel(),\n facetedUniqueValues: createFacetedUniqueValues(),\n facetedMinMaxValues: createFacetedMinMaxValues(),\n filterFns: {\n arrHas: filterFn_arrHas,\n arrIncludes: filterFn_arrIncludes,\n arrIncludesAll: filterFn_arrIncludesAll,\n arrIncludesSome: filterFn_arrIncludesSome,\n between: filterFn_between,\n betweenInclusive: filterFn_betweenInclusive,\n empty: filterFn_empty,\n endsWith: filterFn_endsWith,\n equals: filterFn_equals,\n equalsString: filterFn_equalsString,\n equalsStringSensitive: filterFn_equalsStringSensitive,\n greaterThan: filterFn_greaterThan,\n greaterThanOrEqualTo: filterFn_greaterThanOrEqualTo,\n inDateRange: filterFn_inDateRange,\n inNumberRange: filterFn_inNumberRange,\n includesString: filterFn_includesString,\n includesStringSensitive: filterFn_includesStringSensitive,\n lessThan: filterFn_lessThan,\n lessThanOrEqualTo: filterFn_lessThanOrEqualTo,\n notEmpty: filterFn_notEmpty,\n startsWith: filterFn_startsWith,\n weakEquals: filterFn_weakEquals,\n },\n sortFns: {\n alphanumeric: sortFn_alphanumeric,\n alphanumericCaseSensitive: sortFn_alphanumericCaseSensitive,\n basic: sortFn_basic,\n datetime: sortFn_datetime,\n text: sortFn_text,\n textCaseSensitive: sortFn_textCaseSensitive,\n },\n aggregationFns: {\n sum: aggregationFn_sum,\n min: aggregationFn_min as WithResult<typeof aggregationFn_min, RangeValue>,\n max: aggregationFn_max as WithResult<typeof aggregationFn_max, RangeValue>,\n extent: aggregationFn_extent as WithResult<\n typeof aggregationFn_extent,\n [RangeValue, RangeValue]\n >,\n mean: aggregationFn_mean,\n median: aggregationFn_median,\n unique: aggregationFn_unique,\n uniqueCount: aggregationFn_uniqueCount,\n count: aggregationFn_count,\n first: aggregationFn_first,\n last: aggregationFn_last,\n },\n});\n\nexport type LayoutTableFeatures = typeof layoutTableFeatures;\n\nexport const {\n tableContext,\n cellContext,\n headerContext,\n useTableContext,\n useCellContext,\n useHeaderContext,\n} = createTableHookContexts<LayoutTableFeatures>();\n","import { TablePagination, type TablePaginationProps } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport { useTableContext } from \"~/components/table/context\";\n\nexport type PaginationProps = Omit<\n TablePaginationProps,\n \"count\" | \"page\" | \"rowsPerPage\" | \"onPageChange\" | \"onRowsPerPageChange\" | \"rowsPerPageOptions\"\n> & { pageSizeOptions?: Array<number> };\n\n/** A pager is for large data sets, so it offers no \"All\". LayoutTable starts at the lowest. */\nexport const DEFAULT_PAGE_SIZE_OPTIONS = [25, 50, 100];\n\nexport const Pagination: FC<PaginationProps> = ({\n pageSizeOptions = DEFAULT_PAGE_SIZE_OPTIONS,\n ...props\n}) => {\n // The counts below are table methods; compiled, they would be cached on the table reference,\n // which does not change when only data or options (rowCount, pageCount) do.\n \"use no memo\";\n const table = useTableContext();\n const { pageIndex, pageSize } = table.state.pagination;\n\n return (\n <TablePagination\n component=\"div\"\n showFirstButton\n showLastButton\n {...props}\n sx={[\n { flexShrink: 0, minHeight: 52, borderTop: 1, borderColor: \"divider\" },\n ...(Array.isArray(props.sx) ? props.sx : [props.sx]),\n ]}\n rowsPerPageOptions={pageSizeOptions}\n // pageCount -1 means the total is unknown (cursor paging): MUI shows \"of more than N\" and\n // keeps Next enabled.\n count={table.getPageCount() === -1 ? -1 : table.getRowCount()}\n page={pageIndex}\n rowsPerPage={pageSize}\n onPageChange={(_, page) => table.setPageIndex(page)}\n // One update: a controlled onPaginationChange may resolve two calls against the same state.\n onRowsPerPageChange={(event) =>\n table.setPagination({ pageIndex: 0, pageSize: Number(event.target.value) })\n }\n />\n );\n};\n","import type { Theme } from \"@mui/material\";\nimport type { DisplayHotkey } from \"@tanstack/react-hotkeys\";\nimport { formatForDisplay } from \"@tanstack/react-hotkeys\";\nimport type { Cell, CellData, Column, RowData } from \"@tanstack/react-table\";\nimport type { Range } from \"@tanstack/react-virtual\";\nimport { defaultRangeExtractor } from \"@tanstack/react-virtual\";\nimport type { LayoutTableFeatures } from \"~/components/table/context\";\nimport type { LayoutColumnMeta } from \"./types\";\n\n/** Stable class names on every table part, for `sx` selectors like `.MuiDataGrid-*`. */\nexport const layoutTableClasses = {\n root: \"LayoutTable-root\",\n main: \"LayoutTable-main\",\n table: \"LayoutTable-table\",\n\n toolbar: \"LayoutTable-toolbar\",\n toolbarLabel: \"LayoutTable-toolbarLabel\",\n toolbarTitle: \"LayoutTable-toolbarTitle\",\n toolbarSelectedCount: \"LayoutTable-toolbarSelectedCount\",\n toolbarDivider: \"LayoutTable-toolbarDivider\",\n toolbarQuickFilter: \"LayoutTable-toolbarQuickFilter\",\n columnsButton: \"LayoutTable-columnsButton\",\n columnsPanel: \"LayoutTable-columnsPanel\",\n filtersButton: \"LayoutTable-filtersButton\",\n filterPanel: \"LayoutTable-filterPanel\",\n\n columnHeaders: \"LayoutTable-columnHeaders\",\n columnHeaderRow: \"LayoutTable-columnHeaderRow\",\n columnHeader: \"LayoutTable-columnHeader\",\n \"columnHeader--sortable\": \"LayoutTable-columnHeader--sortable\",\n \"columnHeader--sorted\": \"LayoutTable-columnHeader--sorted\",\n \"columnHeader--filtered\": \"LayoutTable-columnHeader--filtered\",\n \"columnHeader--pinnedStart\": \"LayoutTable-columnHeader--pinnedStart\",\n \"columnHeader--pinnedEnd\": \"LayoutTable-columnHeader--pinnedEnd\",\n columnHeaderContent: \"LayoutTable-columnHeaderContent\",\n columnHeaderTitleContainer: \"LayoutTable-columnHeaderTitleContainer\",\n sortLabel: \"LayoutTable-sortLabel\",\n sortIndex: \"LayoutTable-sortIndex\",\n menuIcon: \"LayoutTable-menuIcon\",\n columnSeparator: \"LayoutTable-columnSeparator\",\n \"columnSeparator--resizable\": \"LayoutTable-columnSeparator--resizable\",\n \"columnSeparator--resizing\": \"LayoutTable-columnSeparator--resizing\",\n\n body: \"LayoutTable-body\",\n row: \"LayoutTable-row\",\n \"row--grouped\": \"LayoutTable-row--grouped\",\n \"row--expanded\": \"LayoutTable-row--expanded\",\n \"row--pinned\": \"LayoutTable-row--pinned\",\n cell: \"LayoutTable-cell\",\n \"cell--selected\": \"LayoutTable-cell--selected\",\n \"cell--grouped\": \"LayoutTable-cell--grouped\",\n \"cell--aggregated\": \"LayoutTable-cell--aggregated\",\n \"cell--pinnedStart\": \"LayoutTable-cell--pinnedStart\",\n \"cell--pinnedEnd\": \"LayoutTable-cell--pinnedEnd\",\n groupCell: \"LayoutTable-groupCell\",\n expandButton: \"LayoutTable-expandButton\",\n actionsCell: \"LayoutTable-actionsCell\",\n cellOffset: \"LayoutTable-cellOffset\",\n rowOffset: \"LayoutTable-rowOffset\",\n filler: \"LayoutTable-filler\",\n skeletonRow: \"LayoutTable-skeletonRow\",\n skeletonCell: \"LayoutTable-skeletonCell\",\n overlay: \"LayoutTable-overlay\",\n\n footer: \"LayoutTable-footer\",\n footerRow: \"LayoutTable-footerRow\",\n footerCell: \"LayoutTable-footerCell\",\n aggregationValue: \"LayoutTable-aggregationValue\",\n pagination: \"LayoutTable-pagination\",\n} as const;\n\nexport const classNames = (...names: Array<string | false | null | undefined>): string =>\n names.filter(Boolean).join(\" \");\n\nexport const pinnedClass = <TData extends RowData, TValue extends CellData>(\n column: AnyColumn<TData, TValue>,\n part: \"columnHeader\" | \"cell\",\n): string | false => {\n const pinned = column.getIsPinned();\n return (\n !!pinned && layoutTableClasses[`${part}--${pinned === \"start\" ? \"pinnedStart\" : \"pinnedEnd\"}`]\n );\n};\n\nexport const shortcutLabel = (label: string, hotkey: DisplayHotkey): string =>\n `${label} (${formatForDisplay(hotkey)})`;\n\ntype AnyColumn<TData extends RowData, TValue extends CellData> = Column<\n LayoutTableFeatures,\n TData,\n TValue\n>;\n\nexport const columnLabel = <TData extends RowData, TValue extends CellData>(\n column: AnyColumn<TData, TValue>,\n): string => {\n const meta = column.columnDef.meta as LayoutColumnMeta | undefined;\n if (meta?.label) return meta.label;\n\n return typeof column.columnDef.header === \"string\" ? column.columnDef.header : column.id;\n};\n\nexport const hasColumnLabel = <TData extends RowData, TValue extends CellData>(\n column: AnyColumn<TData, TValue>,\n): boolean =>\n Boolean((column.columnDef.meta as LayoutColumnMeta | undefined)?.label) ||\n typeof column.columnDef.header === \"string\";\n\nexport const columnAlign = <TData extends RowData, TValue extends CellData>(\n column: AnyColumn<TData, TValue>,\n): \"left\" | \"center\" | \"right\" =>\n (column.columnDef.meta as LayoutColumnMeta | undefined)?.align ??\n (hasColumnLabel(column) ? \"left\" : \"center\");\n\n/** The column's `meta.flex`, or 0 once the user has resized it to a fixed width. */\nexport const columnFlex = <TData extends RowData, TValue extends CellData>(\n column: AnyColumn<TData, TValue>,\n): number =>\n Object.hasOwn(column.table.atoms.columnSizing.get(), column.id)\n ? 0\n : ((column.columnDef.meta as LayoutColumnMeta | undefined)?.flex ?? 0);\n\nexport const moveColumn = <TData extends RowData, TValue extends CellData>(\n column: AnyColumn<TData, TValue>,\n delta: number,\n): void => {\n const { table } = column;\n const current = table.atoms.columnOrder.get();\n const order = current.length ? [...current] : table.getAllLeafColumns().map(({ id }) => id);\n const from = order.indexOf(column.id);\n const to = from + delta;\n if (from < 0 || to < 0 || to >= order.length) return;\n\n order.splice(to, 0, ...order.splice(from, 1));\n table.setColumnOrder(order);\n};\n\nexport const pinnedSx = <TData extends RowData, TValue extends CellData>(\n column: AnyColumn<TData, TValue>,\n isHeader = false,\n) => {\n const pinned = column.getIsPinned();\n if (!pinned) return {};\n\n return {\n position: \"sticky\",\n zIndex: isHeader ? 4 : 2,\n insetInlineStart: pinned === \"start\" ? column.getStart(\"start\") : undefined,\n insetInlineEnd: pinned === \"end\" ? column.getAfter(\"end\") : undefined,\n bgcolor: \"background.paper\",\n ...(!isHeader && {\n \".MuiTableRow-root:hover > &\": {\n backgroundImage: (theme: Theme) =>\n `linear-gradient(${theme.palette.action.hover}, ${theme.palette.action.hover})`,\n },\n \".MuiTableRow-root.Mui-selected > &\": {\n backgroundImage: (theme: Theme) =>\n `linear-gradient(${theme.palette.action.selected}, ${theme.palette.action.selected})`,\n },\n }),\n ...(pinned === \"start\" &&\n column.getIsLastColumn(\"start\") && {\n borderInlineEnd: 1,\n borderInlineEndStyle: \"solid\",\n borderColor: \"divider\",\n }),\n ...(pinned === \"end\" &&\n column.getIsFirstColumn(\"end\") && {\n borderInlineStart: 1,\n borderInlineStartStyle: \"solid\",\n borderColor: \"divider\",\n }),\n };\n};\n\nexport const cellSelectionSx = <TData extends RowData, TValue extends CellData>(\n cell: Cell<LayoutTableFeatures, TData, TValue>,\n) => {\n if (!cell.getIsSelected()) return {};\n\n const edges = cell.getSelectionEdges();\n const outline = (theme: Theme) =>\n [\n edges.top && `inset 0 2px 0 0 ${theme.palette.primary.main}`,\n edges.bottom && `inset 0 -2px 0 0 ${theme.palette.primary.main}`,\n edges.left && `inset 2px 0 0 0 ${theme.palette.primary.main}`,\n edges.right && `inset -2px 0 0 0 ${theme.palette.primary.main}`,\n ]\n .filter(Boolean)\n .join(\", \") || \"none\";\n\n return {\n backgroundImage: (theme: Theme) =>\n `linear-gradient(${theme.palette.action.selected}, ${theme.palette.action.selected})`,\n boxShadow: outline,\n };\n};\n\n/** Spreadsheet TSV quoting, so a cell holding a tab or a newline stays one cell. */\nconst quoteTsv = (text: string): string =>\n /[\"\\t\\n\\r]/.test(text) ? `\"${text.replaceAll('\"', '\"\"')}\"` : text;\n\nconst toClipboardValue = (value: unknown): string => {\n if (value == null) return \"\";\n if (typeof value === \"string\") return quoteTsv(value);\n if (typeof value === \"number\" || typeof value === \"boolean\" || typeof value === \"bigint\")\n return quoteTsv(String(value));\n if (value instanceof Date) return quoteTsv(value.toISOString());\n\n // Everything else — objects, and the odd symbol or function — as JSON or blank.\n return quoteTsv(JSON.stringify(value) ?? \"\");\n};\n\n/**\n * Serializes `table.getSelectedCellRangesData()` as TSV, which is what Excel,\n * Google Sheets and LibreOffice all paste as a grid. Disjoint selection regions\n * are separated by a blank line.\n */\nexport const toClipboardText = (regions: Array<Array<Array<unknown>>>): string =>\n regions\n .map((rows) => rows.map((cells) => cells.map(toClipboardValue).join(\"\\t\")).join(\"\\n\"))\n .join(\"\\n\\n\");\n\nexport const lookaheadRange = (\n range: Range,\n direction: \"forward\" | \"backward\" | null,\n lookahead: number,\n): Array<number> => {\n const behind = direction ? 0 : range.overscan;\n const ahead = direction ? lookahead : range.overscan;\n\n return defaultRangeExtractor({\n ...range,\n startIndex: range.startIndex - (direction === \"backward\" ? ahead : behind),\n endIndex: range.endIndex + (direction === \"backward\" ? behind : ahead),\n overscan: 0,\n });\n};\n","import dayjs from \"dayjs\";\n\nexport const formatValue = (value: unknown, dateFormat = \"L LT\"): string => {\n if (value === null || value === undefined) return \"\";\n if (value instanceof Date) return dayjs(value).format(dateFormat);\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\" || typeof value === \"bigint\") {\n return value.toString();\n }\n\n return JSON.stringify(value) ?? \"\";\n};\n","import type { TypographyProps } from \"@mui/material\";\nimport { Typography } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport { formatValue } from \"~/components/table/formatValue\";\nimport { useCellContext } from \"~/components/table/context\";\n\nexport const AggregatedCell: FC<\n TypographyProps & {\n prefix?: string;\n options?: Intl.NumberFormatOptions;\n dateFormat?: string;\n }\n> = ({ prefix = \"\", options, dateFormat, ...props }) => {\n const cell = useCellContext();\n const value = cell.getValue();\n if (value === null || value === undefined || value === \"\") return null;\n\n const format = (entry: unknown) =>\n typeof entry === \"number\"\n ? entry.toLocaleString(undefined, options)\n : formatValue(entry, dateFormat);\n\n return (\n <Typography variant=\"body2\" color=\"text.secondary\" noWrap {...props}>\n {prefix}\n {/* `extent` — the default aggregate for anything non-numeric — is a [min, max] pair. */}\n {Array.isArray(value) ? value.map(format).join(\" – \") : format(value)}\n </Typography>\n );\n};\n","import {\n Accordion,\n AccordionActions,\n AccordionDetails,\n AccordionSummary,\n Alert,\n AlertTitle,\n Avatar,\n AvatarGroup,\n Badge,\n Box,\n Breadcrumbs,\n Button,\n ButtonGroup,\n Card,\n CardActions,\n CardContent,\n CardHeader,\n CardMedia,\n Checkbox,\n Chip,\n CircularProgress,\n Divider,\n FormControl,\n FormControlLabel,\n FormGroup,\n FormHelperText,\n FormLabel,\n Grid,\n ImageList,\n ImageListItem,\n ImageListItemBar,\n InputLabel,\n LinearProgress,\n Link,\n List,\n ListItem,\n ListItemAvatar,\n ListItemText,\n ListSubheader,\n MenuItem,\n Paper,\n Radio,\n RadioGroup,\n Rating,\n Select,\n Skeleton,\n Slider,\n Stack,\n Step,\n StepContent,\n StepLabel,\n Stepper,\n Switch,\n Table,\n TableBody,\n TableCell,\n TableContainer,\n TableFooter,\n TableHead,\n TableRow,\n TextField,\n Tooltip,\n Typography,\n} from \"@mui/material\";\nimport { toolDefinition } from \"@tanstack/ai/client\";\nimport type { ElementType } from \"react\";\nimport { z } from \"zod\";\n\n/**\n * The MUI components the model may render, under their own names. Props pass through\n * untouched, so they are MUI's official props (`ComponentProps<typeof Card>`). Add a\n * component here and both tools offer it. Left out: anything that needs state, an icon,\n * an overlay or a callback to work.\n */\nexport const components = {\n Accordion,\n AccordionActions,\n AccordionDetails,\n AccordionSummary,\n Alert,\n AlertTitle,\n Avatar,\n AvatarGroup,\n Badge,\n Box,\n Breadcrumbs,\n Button,\n ButtonGroup,\n Card,\n CardActions,\n CardContent,\n CardHeader,\n CardMedia,\n Checkbox,\n Chip,\n CircularProgress,\n Divider,\n FormControl,\n FormControlLabel,\n FormGroup,\n FormHelperText,\n FormLabel,\n Grid,\n ImageList,\n ImageListItem,\n ImageListItemBar,\n InputLabel,\n LinearProgress,\n Link,\n List,\n ListItem,\n ListItemAvatar,\n ListItemText,\n ListSubheader,\n MenuItem,\n Paper,\n Radio,\n RadioGroup,\n Rating,\n Select,\n Skeleton,\n Slider,\n Stack,\n Step,\n StepContent,\n StepLabel,\n Stepper,\n Switch,\n Table,\n TableBody,\n TableCell,\n TableContainer,\n TableFooter,\n TableHead,\n TableRow,\n TextField,\n Tooltip,\n Typography,\n} satisfies Record<string, ElementType>;\n\nexport type ComponentName = keyof typeof components;\n\n/**\n * The TanStack Charts marks a `Chart` node takes as children, under their own names. Props pass\n * through untouched too: the rows as `data`, the rest the mark's official options. Only the\n * names live here; the marks load with the first chart, so a chart costs nothing until one shows.\n */\nexport const chartMarks = [\n \"areaX\",\n \"areaY\",\n \"arrow\",\n \"bandX\",\n \"bandY\",\n \"barX\",\n \"barY\",\n \"boxX\",\n \"boxY\",\n \"cell\",\n \"crosshair\",\n \"differenceX\",\n \"differenceY\",\n \"dot\",\n \"frame\",\n \"hexagon\",\n \"lineX\",\n \"lineY\",\n \"linearRegressionX\",\n \"linearRegressionY\",\n \"link\",\n \"rect\",\n \"ridgelineX\",\n \"ridgelineY\",\n \"ruleX\",\n \"ruleY\",\n \"text\",\n \"tickX\",\n \"tickY\",\n \"vector\",\n \"violinX\",\n \"violinY\",\n \"waffleX\",\n \"waffleY\",\n] as const;\n\nexport type ChartMarkName = (typeof chartMarks)[number];\n\ntype NodeType = ComponentName | \"Chart\" | ChartMarkName;\n\n/**\n * `show_ui` and `ask_user`. Built on call, not at import: `wcz-layout/hooks` is imported by\n * every app, and module-level calls survive tree-shaking, registry and all.\n */\nexport function createUiTools() {\n const types: Array<NodeType> = [\n ...(Object.keys(components) as Array<ComponentName>),\n \"Chart\",\n ...chartMarks,\n ];\n const UiNode = z.object({\n type: z.enum(types as [NodeType, ...Array<NodeType>]),\n props: z\n .record(z.string(), z.unknown())\n .optional()\n .describe(\n \"Official props of the MUI component (sx works), or of the TanStack Charts chart or mark. \" +\n \"A prop can hold a node.\",\n ),\n get children() {\n const child = z.union([z.string(), z.number(), UiNode]);\n return z\n .union([child, z.array(child)])\n .optional()\n .describe(\"Text, a node, or a list of them\");\n },\n });\n const uiInput = z.object({ ui: UiNode });\n\n return [\n toolDefinition({\n name: \"show_ui\",\n description:\n \"Show Material UI (MUI v9) components in the chat. Prefer it to markdown for structured \" +\n \"content: tables, cards, lists, key facts, statuses, steps and progress.\" +\n \"`ui` is one node { type, props, children }: `type` is the component, `props` its \" +\n \"official MUI props (sx works; a prop can hold a node, e.g. CardHeader avatar or Alert \" +\n \"action), `children` text, a node or a list of them. MUI v9 has no system props: \" +\n \"alignItems, gap, p, m and the like go in sx. Grid takes `container`, and `size` on \" +\n \"children (e.g. { xs: 12, sm: 6 }); never `item` or `xs`. The chat can be as narrow as \" +\n \"a phone. Callbacks do nothing; to let the user answer, use ask_user. \" +\n \"A Chart node draws numbers that compare or change with TanStack Charts. Its props are \" +\n \"the defineChart spec without marks: scales.x and scales.y, each { scale: 'band' for \" +\n \"categories, 'point' for ordered labels such as months, 'linear' for numbers (the \" +\n \"default), and the official options such as axis: { label }, grid, nice; padding and a \" +\n \"fixed domain work too }, color ({ legend: true for several series, domain }), focus \" +\n \"('group-x' for lines); and the Chart's ariaLabel and height. Its children are the \" +\n \"marks (barY, barX, lineY, areaY, dot, ruleY, text, cell, crosshair and the rest), each \" +\n \"with props { data: the rows, then the mark's official options, channels naming fields, \" +\n \"e.g. x: 'month', y: 'count', color: 'state' }. Bars at the same x stack; layout: \" +\n \"{ type: 'group' } puts them side by side. A line takes points: true for its dots: a \" +\n \"dot mark of its own adds a second tooltip row. Dates are labels: there is no time scale.\",\n inputSchema: uiInput,\n }).client(() => ({ shown: true })),\n toolDefinition({\n name: \"ask_user\",\n description:\n \"Ask the user with a Material UI form and wait for the answer. Same `ui` format as \" +\n \"show_ui. Give every input a `name`: TextField (type date/number work; select: true \" +\n \"with MenuItem children), FormControlLabel with a Checkbox, Switch or Radio `control`, \" +\n \"RadioGroup, Slider, Rating. Add Button(s) with type 'submit'; the clicked button's \" +\n \"name/value is included, so several buttons work as choices. Returns { [name]: value }: \" +\n \"repeated names give arrays, unchecked boxes are left out. Never use it to confirm a \" +\n \"tool call: tools that need approval ask the user themselves.\",\n inputSchema: uiInput,\n }).client(),\n ] as const;\n}\n","import { Alert, Box, Skeleton, Typography } from \"@mui/material\";\nimport { parsePartialJSON } from \"@tanstack/ai-react\";\nimport type { UIMessage } from \"@tanstack/ai-react\";\nimport { CatchBoundary } from \"@tanstack/react-router\";\nimport { createContext, lazy, Suspense, useContext } from \"react\";\nimport type { ElementType, FormEvent, Key, ReactNode } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { components } from \"~/lib/ai/tools/ui\";\nimport type { ComponentName } from \"~/lib/ai/tools/ui\";\n\ntype ToolCallPart = Extract<UIMessage[\"parts\"][number], { type: \"tool-call\" }>;\n\n/** Keys that run code or swap the rendered element. Checked at every depth: slotProps nest. */\nconst BLOCKED =\n /^([oO][nN]|form[A-Z]|component$|slots$|as$|key$|ref$|dangerouslySetInnerHTML$)|(Component|Ref)$/;\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst isNode = (\n value: unknown,\n): value is { type: ComponentName; props?: unknown; children?: unknown } =>\n isRecord(value) && typeof value.type === \"string\" && Object.hasOwn(components, value.type);\n\nconst isChart = (value: unknown): value is Record<string, unknown> =>\n isRecord(value) && value.type === \"Chart\";\n\nconst GeneratedChart = lazy(() =>\n import(\"./generatedChart\").then(({ GeneratedChart }) => ({ default: GeneratedChart })),\n);\n\nconst Streaming = createContext(false);\n\n/** Drawn once the arguments are complete; its data and options reach TanStack Charts as written. */\nfunction ChartNode({ node }: Readonly<{ node: Record<string, unknown> }>) {\n const streaming = useContext(Streaming);\n const { height } = isRecord(node.props) ? node.props : {};\n const placeholder = (\n <Skeleton variant=\"rounded\" height={typeof height === \"number\" ? height : 280} />\n );\n\n return streaming ? (\n placeholder\n ) : (\n <Suspense fallback={placeholder}>\n <GeneratedChart node={node} />\n </Suspense>\n );\n}\n\n/** Model-written props without blocked keys or password fields; nodes become elements. */\nconst toProps = (value: unknown): unknown => {\n if (isNode(value) || isChart(value)) return renderGeneratedUi(value);\n if (Array.isArray(value)) return value.map(toProps);\n if (!isRecord(value)) return value;\n return Object.fromEntries(\n Object.entries(value)\n .filter(([name, item]) => !BLOCKED.test(name) && !(name === \"type\" && item === \"password\"))\n .map(([name, item]) => [name, toProps(item)]),\n );\n};\n\n/** A node tree as the model wrote it. Anything that is not a known component renders nothing. */\nexport function renderGeneratedUi(value: unknown, key?: Key): ReactNode {\n if (typeof value === \"string\" || typeof value === \"number\") return value;\n // A lone child stays unwrapped: Tooltip and friends take exactly one element.\n if (Array.isArray(value))\n return value.length === 1 ? renderGeneratedUi(value[0], key) : value.map(renderGeneratedUi);\n if (isChart(value)) return <ChartNode key={key} node={value} />;\n if (!isNode(value)) return null;\n\n const Component: ElementType = components[value.type];\n const { children, ...props } = isRecord(value.props) ? value.props : {};\n return (\n <Component key={key} {...(toProps(props) as Record<string, unknown>)}>\n {renderGeneratedUi(value.children ?? children)}\n </Component>\n );\n}\n\n/** `show_ui`. Renders while the arguments still stream, so the UI builds up as the model writes it. */\nexport function GeneratedUi({ part }: Readonly<{ part: ToolCallPart }>) {\n const { t } = useTranslation();\n const input = (part.input ?? (parsePartialJSON(part.arguments) as unknown)) as\n | { ui?: unknown }\n | undefined;\n\n return (\n // Wide content (a table with many columns) scrolls inside the chat instead of widening the page.\n <Box sx={{ overflowX: \"auto\", m: -0.5, p: 0.5 }}>\n <CatchBoundary\n getResetKey={() => part.arguments}\n errorComponent={() => <Alert severity=\"warning\">{t(\"Layout.Chat.RenderFailed\")}</Alert>}\n >\n <Streaming value={part.input === undefined}>{renderGeneratedUi(input?.ui)}</Streaming>\n </CatchBoundary>\n </Box>\n );\n}\n\n/** `ask_user`. Submitting sends `{ [name]: value }` back to the model as the tool's result. */\nexport function AskUser({\n part,\n disabled,\n onAnswer,\n}: Readonly<{\n part: ToolCallPart;\n disabled: boolean;\n onAnswer: (values: Record<string, unknown>) => void;\n}>) {\n const answer: unknown = part.output;\n\n const submit = (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n const { submitter } = event.nativeEvent as SubmitEvent;\n const values: Record<string, unknown> = {};\n for (const [name, value] of new FormData(event.currentTarget, submitter)) {\n const previous = values[name];\n values[name] = previous === undefined ? value : [previous, value].flat();\n }\n onAnswer(values);\n };\n\n return (\n <Box component=\"form\" onSubmit={submit}>\n <Box\n component=\"fieldset\"\n disabled={disabled}\n sx={{\n border: 0,\n m: 0,\n p: 0,\n minWidth: 0,\n opacity: answer === undefined ? 1 : 0.6,\n pointerEvents: disabled ? \"none\" : undefined,\n }}\n >\n <GeneratedUi part={part} />\n </Box>\n {isRecord(answer) && (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {Object.entries(answer)\n .map(([name, value]) => `${name}: ${String(value)}`)\n .join(\", \")}\n </Typography>\n )}\n </Box>\n );\n}\n","import type { ContentPart } from \"@tanstack/ai/client\";\n\n// A file travels with every request of the conversation, so a large one is refused.\nconst MAX_BYTES = 10 * 1024 * 1024;\n// The longest side a vision model reads in full. A phone photo is three times that.\nconst MAX_IMAGE_SIDE = 1568;\n\n// The documents the gateway's models read as they are, by extension: the browser's own type for\n// a file is often empty or another one (a .csv is an Excel file to Windows).\nconst DOCUMENTS: Record<string, string | undefined> = {\n pdf: \"application/pdf\",\n docx: \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n xlsx: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n pptx: \"application/vnd.openxmlformats-officedocument.presentationml.presentation\",\n rtf: \"application/rtf\",\n csv: \"text/csv\",\n md: \"text/markdown\",\n json: \"application/json\",\n html: \"text/html\",\n txt: \"text/plain\",\n};\n\nconst base64 = (file: Blob) =>\n new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n // A data URL: the base64 follows its comma.\n reader.onload = () => resolve((reader.result as string).split(\",\")[1]);\n reader.onerror = () => reject(reader.error ?? new Error(\"Cannot read the file\"));\n reader.readAsDataURL(file);\n });\n\n/** An image as the model sees it: a JPEG no larger than it reads, base64. */\nasync function readImage(file: Blob) {\n const image = await createImageBitmap(file);\n const scale = Math.min(1, MAX_IMAGE_SIDE / Math.max(image.width, image.height));\n const canvas = document.createElement(\"canvas\");\n canvas.width = Math.round(image.width * scale);\n canvas.height = Math.round(image.height * scale);\n const context = canvas.getContext(\"2d\");\n if (!context) throw new Error(\"No canvas\");\n // JPEG has no transparency: a see-through screenshot would turn black.\n context.fillStyle = \"#fff\";\n context.fillRect(0, 0, canvas.width, canvas.height);\n context.drawImage(image, 0, 0, canvas.width, canvas.height);\n return canvas.toDataURL(\"image/jpeg\", 0.85).split(\",\")[1];\n}\n\n/**\n * A file as one part of a user message, kept in the conversation and never uploaded to the file\n * service. The model reads it as it is: an image of any kind the browser shows, and a document\n * (PDF, Word, Excel, PowerPoint, CSV or text). Throws for a file it cannot read or a large one.\n */\nexport async function fileToPart(file: File): Promise<ContentPart> {\n if (file.type.startsWith(\"image/\"))\n return {\n type: \"image\",\n source: { type: \"data\", value: await readImage(file), mimeType: \"image/jpeg\" },\n };\n const extension = file.name.split(\".\").at(-1)?.toLowerCase() ?? \"\";\n // Any other text, such as a log or source code, reads as plain text.\n const mimeType = DOCUMENTS[extension] ?? (file.type.startsWith(\"text/\") ? \"text/plain\" : \"\");\n if (!mimeType || file.size > MAX_BYTES) throw new Error(`Cannot attach ${file.name}`);\n return {\n type: \"document\",\n source: { type: \"data\", value: await base64(file), mimeType },\n metadata: { filename: file.name },\n };\n}\n","import Add from \"@mui/icons-material/Add\";\nimport ArrowUpward from \"@mui/icons-material/ArrowUpward\";\nimport AttachFile from \"@mui/icons-material/AttachFile\";\nimport Refresh from \"@mui/icons-material/Refresh\";\nimport Stop from \"@mui/icons-material/Stop\";\nimport {\n Alert,\n Avatar,\n Box,\n Button,\n Chip,\n IconButton,\n InputBase,\n Link,\n Paper,\n Stack,\n Tooltip,\n Typography,\n} from \"@mui/material\";\nimport type { SxProps, Theme } from \"@mui/material\";\nimport { keyframes } from \"@mui/material/styles\";\nimport { visuallyHidden } from \"@mui/utils\";\nimport { parsePartialJSON } from \"@tanstack/ai-react\";\nimport type { UIMessage, UseChatReturn } from \"@tanstack/ai-react\";\nimport type { ContentPart } from \"@tanstack/ai/client\";\nimport { streamingMarkdownExtension } from \"@tanstack/markdown/extensions/streaming\";\nimport { Markdown } from \"@tanstack/markdown/react\";\nimport type { TFunction } from \"i18next\";\nimport { useEffect, useRef, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, FormEvent, KeyboardEvent } from \"react\";\nimport { useDropzone } from \"react-dropzone\";\nimport { useTranslation } from \"react-i18next\";\nimport { AskUser, GeneratedUi } from \"~/components/chat/generatedUi\";\nimport { RouterLink } from \"~/components/router/RouterLink\";\nimport { useDialogs } from \"~/hooks/useDialogs\";\nimport { fileToPart } from \"~/lib/ai/attachments\";\n\ntype Chat = UseChatReturn;\ntype ToolCallPart = Extract<UIMessage[\"parts\"][number], { type: \"tool-call\" }>;\ntype ImagePart = Extract<ContentPart, { type: \"image\" }>;\n/** A file the user attached, waiting in the input until the message is sent. */\ntype Attached = { name: string; part: ContentPart };\n\n/** One centered reading column, like ChatGPT: full width on a phone, 48rem on a desktop. */\nconst columnSx = { width: \"100%\", maxWidth: \"48rem\", mx: \"auto\", px: 2 } as const;\n\nconst markdownSx = {\n typography: \"body1\",\n overflowWrap: \"anywhere\",\n \"& > *\": { my: 0 },\n \"& > * + *\": { mt: 2 },\n \"& pre\": { overflowX: \"auto\", p: 1.5, borderRadius: 2, bgcolor: \"action.hover\" },\n \"& :not(pre) > code\": { px: 0.5, borderRadius: 1, bgcolor: \"action.hover\" },\n \"& table\": { display: \"block\", overflowX: \"auto\", borderCollapse: \"collapse\" },\n \"& th, & td\": { border: 1, borderColor: \"divider\", px: 1, py: 0.5 },\n \"& img\": { maxWidth: \"100%\" },\n} as const;\n\n// Hides a half-written heading or list item while the reply streams.\nconst markdownExtensions = [streamingMarkdownExtension()];\n\n/** The app's own pages open in place, through the router; anything else in a new tab. */\nfunction MarkdownLink({ href = \"\", children }: ComponentPropsWithoutRef<\"a\">) {\n return href.startsWith(\"/\") && !href.startsWith(\"//\") ? (\n <RouterLink to={href}>{children}</RouterLink>\n ) : (\n <Link href={href} target=\"_blank\" rel=\"noreferrer\">\n {children}\n </Link>\n );\n}\n\nconst markdownComponents = { a: MarkdownLink };\n\nconst shimmer = keyframes`\n from { background-position: 100% 0; }\n to { background-position: -100% 0; }\n`;\n\n/** The model is working on a reply, but nothing of it is on screen yet. */\nexport function isReasoning({ isLoading, messages }: Pick<Chat, \"isLoading\" | \"messages\">) {\n const last = messages.at(-1);\n const part = last?.role === \"assistant\" ? last.parts.at(-1) : undefined;\n // A tool call shows its own line or UI until its result is in.\n const streaming =\n (part?.type === \"text\" && part.content !== \"\") ||\n (part?.type === \"tool-call\" && part.output === undefined);\n return isLoading && !streaming;\n}\n\n/** After a scroll event: at the bottom it follows new content, after a scroll up it stops. */\nexport function keepsFollowing(\n following: boolean,\n previousTop: number,\n {\n scrollTop,\n scrollHeight,\n clientHeight,\n }: Pick<HTMLElement, \"scrollTop\" | \"scrollHeight\" | \"clientHeight\">,\n) {\n if (scrollHeight - clientHeight - scrollTop <= 1) return true;\n return scrollTop < previousTop ? false : following;\n}\n\n/** Keeps the scroll container at the bottom while content grows, unless the user scrolled up. */\nfunction useFollowContent() {\n const ref = useRef<HTMLDivElement>(null);\n const following = useRef(true);\n\n useEffect(() => {\n const scroller = ref.current;\n if (!scroller) return;\n let previousTop = scroller.scrollTop;\n\n const onScroll = () => {\n following.current = keepsFollowing(following.current, previousTop, scroller);\n previousTop = scroller.scrollTop;\n };\n const observer = new ResizeObserver(() => {\n if (!following.current) return;\n scroller.scrollTop = scroller.scrollHeight;\n previousTop = scroller.scrollTop;\n });\n\n scroller.addEventListener(\"scroll\", onScroll, { passive: true });\n observer.observe(scroller);\n for (const child of scroller.children) observer.observe(child);\n return () => {\n scroller.removeEventListener(\"scroll\", onScroll);\n observer.disconnect();\n };\n }, []);\n\n return { ref, following };\n}\n\nconst shimmerSx: SxProps<Theme> = (theme) => {\n const { text } = (theme.vars ?? theme).palette;\n return {\n alignSelf: \"flex-start\",\n color: \"transparent\",\n backgroundImage: `linear-gradient(90deg, ${text.disabled} 40%, ${text.primary} 50%, ${text.disabled} 60%)`,\n backgroundSize: \"200% 100%\",\n backgroundClip: \"text\",\n WebkitBackgroundClip: \"text\",\n animation: `${shimmer} 2s linear infinite`,\n \"@media (prefers-reduced-motion: reduce)\": { animation: \"none\" },\n };\n};\n\n// Status lines in a row sit together.\nconst statusClass = \"LayoutChat-status\";\n\nfunction Reasoning() {\n const { t } = useTranslation();\n\n return (\n <Typography className={statusClass} sx={shimmerSx}>\n {t(\"Layout.Chat.Reasoning\")}\n </Typography>\n );\n}\n\ntype ActivityKey =\n | \"WritingCode\"\n | \"RunningCode\"\n | \"RanCode\"\n | \"FindingTools\"\n | \"FoundTools\"\n | \"ReadingPage\"\n | \"ReadPage\"\n | \"Clicking\"\n | \"Clicked\"\n | \"Filling\"\n | \"Filled\"\n | \"PressingKey\"\n | \"PressedKey\"\n | \"UsingTool\"\n | \"UsedTool\";\n\n/** A tool's words while the model writes its input, while it runs, and once it is done. */\nconst activities: Record<string, [ActivityKey, ActivityKey, ActivityKey] | undefined> = {\n execute_typescript: [\"WritingCode\", \"RunningCode\", \"RanCode\"],\n discover_tools: [\"FindingTools\", \"FindingTools\", \"FoundTools\"],\n __lazy__tool__discovery__: [\"FindingTools\", \"FindingTools\", \"FoundTools\"],\n read_page: [\"ReadingPage\", \"ReadingPage\", \"ReadPage\"],\n click: [\"Clicking\", \"Clicking\", \"Clicked\"],\n fill: [\"Filling\", \"Filling\", \"Filled\"],\n press_key: [\"PressingKey\", \"PressingKey\", \"PressedKey\"],\n};\n\n/** A tool's name as words: external_create_device is \"create device\". */\nconst words = (name: string) => name.replace(/^external_/, \"\").replaceAll(\"_\", \" \");\n\n/** The functions a program calls, or a lookup asks for, as words: \"list devices, create device\". */\nfunction functionsOf({ input, arguments: json }: ToolCallPart) {\n // Read while the input still streams, so they show as the program is written.\n const { typescriptCode, toolNames } = (input ?? parsePartialJSON(json) ?? {}) as {\n typescriptCode?: unknown;\n toolNames?: unknown;\n };\n const called =\n typeof typescriptCode === \"string\"\n ? Array.from(typescriptCode.matchAll(/external_(\\w+)/g), ([, name]) => name)\n : [];\n const asked = Array.isArray(toolNames)\n ? toolNames.filter((name): name is string => typeof name === \"string\")\n : [];\n return [...new Set([...asked, ...called].map(words))].join(\", \");\n}\n\n/** What a page tool acted on, for its line: the element clicked, the values filled, the key. */\nfunction targetOf({ input }: ToolCallPart) {\n const { name, key, fields } = (input ?? {}) as {\n name?: string;\n key?: string;\n fields?: Array<{ value?: string }>;\n };\n const target = name ?? key ?? fields?.map(({ value }) => value).join(\", \") ?? \"\";\n return target.length > 60 ? `${target.slice(0, 59)}…` : target;\n}\n\nfunction activityOf({ name, state, output }: ToolCallPart, live: boolean) {\n const [writing, running, done] = activities[name] ?? [\"UsingTool\", \"UsingTool\", \"UsedTool\"];\n if (output !== undefined) return state === \"error\" ? \"ToolStopped\" : done;\n if (!live) return \"ToolStopped\";\n return state === \"awaiting-input\" || state === \"input-streaming\" ? writing : running;\n}\n\n/** A tool's line in words, e.g. \"Running code… · list devices\". */\nconst activityText = (t: TFunction, part: ToolCallPart, live: boolean) =>\n [\n t(`Layout.Chat.${activityOf(part, live)}`, { name: words(part.name), target: targetOf(part) }),\n functionsOf(part),\n ]\n .filter(Boolean)\n .join(\" · \");\n\n/** A tool without UI of its own, as one line: what it does while it runs, then what it did. */\nfunction ToolActivity({ part, live }: Readonly<{ part: ToolCallPart; live: boolean }>) {\n const { t } = useTranslation();\n const running = live && part.output === undefined;\n\n return (\n <Typography\n variant=\"body2\"\n className={statusClass}\n sx={running ? shimmerSx : { color: \"text.secondary\" }}\n >\n {activityText(t, part, live)}\n </Typography>\n );\n}\n\n/** The name a document was attached under. */\nconst fileNameOf = (part: { type: string; metadata?: unknown }) =>\n part.type === \"document\"\n ? ((part.metadata as { filename?: string } | undefined)?.filename ?? \"document\")\n : undefined;\n\nconst srcOf = ({ source }: Pick<ImagePart, \"source\">) =>\n source.type === \"data\" ? `data:${source.mimeType};base64,${source.value}` : source.value;\n\nfunction ChatMessage({\n message,\n live,\n canAnswer,\n addToolResult,\n}: Readonly<{\n message: UIMessage;\n live: boolean;\n canAnswer: boolean;\n addToolResult: Chat[\"addToolResult\"];\n}>) {\n if (message.role === \"user\") {\n const typed = message.parts.flatMap((part) => (part.type === \"text\" ? [part.content] : []));\n const files = message.parts.filter(({ type }) => type === \"image\" || type === \"document\");\n return (\n <Stack spacing={1} sx={{ alignSelf: \"flex-end\", alignItems: \"flex-end\", maxWidth: \"80%\" }}>\n {files.length > 0 && (\n <Stack direction=\"row\" sx={{ flexWrap: \"wrap\", justifyContent: \"flex-end\", gap: 0.5 }}>\n {files.map((part, index) =>\n part.type === \"image\" ? (\n <Box\n key={index}\n component=\"img\"\n src={srcOf(part)}\n alt=\"Attached image\"\n sx={{ maxWidth: \"100%\", maxHeight: 160, borderRadius: 3 }}\n />\n ) : (\n <Chip key={index} variant=\"outlined\" label={fileNameOf(part)} />\n ),\n )}\n </Stack>\n )}\n {typed.length > 0 && (\n <Typography\n sx={{\n px: 2,\n py: 1.25,\n borderRadius: 4.5,\n bgcolor: \"action.hover\",\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n }}\n >\n {typed.join(\"\\n\")}\n </Typography>\n )}\n </Stack>\n );\n }\n\n return message.parts.map((part, index) => {\n if (part.type === \"text\")\n return part.content ? (\n <Box key={index} sx={markdownSx}>\n <Markdown extensions={markdownExtensions} components={markdownComponents}>\n {part.content}\n </Markdown>\n </Box>\n ) : null;\n if (part.type !== \"tool-call\") return null;\n const ui = part.name === \"show_ui\" || part.name === \"ask_user\";\n // The model draws a UI whose input failed again.\n if (ui && part.state === \"error\") return null;\n if (part.name === \"show_ui\") return <GeneratedUi key={part.id} part={part} />;\n if (part.name === \"ask_user\")\n return (\n <AskUser\n key={part.id}\n part={part}\n disabled={!canAnswer || part.output !== undefined}\n onAnswer={(output) =>\n void addToolResult({ toolCallId: part.id, tool: part.name, output })\n }\n />\n );\n return <ToolActivity key={part.id} part={part} live={live} />;\n });\n}\n\n/** Confirms a server tool marked `needsApproval`; the model has said what it is about to do. */\nfunction Approvals({ chat }: Readonly<{ chat: Chat }>) {\n const { t } = useTranslation();\n\n // Server tools are not registered on the client, so the typed `kind: \"tool-approval\"` never\n // matches here; the server's metadata marks the interrupt as an approval.\n return chat.interrupts.map((interrupt) =>\n interrupt.metadata?.kind === \"approval\" &&\n interrupt.status === \"pending\" &&\n \"resolveInterrupt\" in interrupt ? (\n <Alert\n key={interrupt.id}\n severity=\"warning\"\n action={\n <Stack direction=\"row\" spacing={1}>\n <Button\n color=\"inherit\"\n size=\"small\"\n disabled={chat.resuming}\n onClick={() => interrupt.resolveInterrupt(false)}\n >\n {t(\"Layout.Dialog.Cancel\")}\n </Button>\n <Button\n color=\"inherit\"\n size=\"small\"\n disabled={chat.resuming}\n onClick={() => interrupt.resolveInterrupt(true)}\n >\n {t(\"Layout.Dialog.Confirm\")}\n </Button>\n </Stack>\n }\n >\n {t(\"Layout.Chat.AreYouSure\")}\n </Alert>\n ) : null,\n );\n}\n\nconst roundButtonSx = {\n bgcolor: \"text.primary\",\n color: \"background.paper\",\n \"&:hover\": { bgcolor: \"text.secondary\" },\n} as const;\n\n/** A message waiting for the reply to end, as one line: what was typed, or the files' names. */\nfunction queuedText(queued: Chat[\"queue\"][number][\"content\"]) {\n const content = typeof queued === \"string\" ? queued : queued.content;\n if (typeof content === \"string\") return content;\n const texts = content.flatMap((part) =>\n part.type === \"text\" ? [part.content] : (fileNameOf(part) ?? []),\n );\n return texts.join(\" · \") || \"…\";\n}\n\ninterface ChatInputProps {\n chat: Chat;\n files: Array<Attached>;\n setFiles: (files: Array<Attached>) => void;\n /** Opens the file picker. */\n pick: () => void;\n onSend: () => void;\n}\n\nfunction ChatInput({ chat, files, setFiles, pick, onSend }: Readonly<ChatInputProps>) {\n const { t } = useTranslation();\n const { confirm } = useDialogs();\n const [draft, setDraft] = useState(\"\");\n const ready = draft.trim() !== \"\" || files.length > 0;\n\n // A message sent while the reply still streams waits in the chat's queue, shown above the input.\n const send = (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (!ready) return;\n onSend();\n const parts = files.map(({ part }) => part);\n if (draft.trim()) parts.push({ type: \"text\", content: draft.trim() });\n void chat.sendMessage(files.length ? { content: parts } : draft.trim());\n setDraft(\"\");\n setFiles([]);\n };\n\n // Enter sends and Shift+Enter breaks the line; Enter that ends an IME composition (CJK) does neither.\n const sendOnEnter = (event: KeyboardEvent<HTMLFormElement>) => {\n if (event.key !== \"Enter\" || event.shiftKey || event.nativeEvent.isComposing) return;\n if (!(event.target instanceof HTMLTextAreaElement)) return;\n event.preventDefault();\n event.currentTarget.requestSubmit();\n };\n\n const newChat = async () => {\n if (await confirm(t(\"Layout.Chat.NewChatConfirm\"))) chat.clear();\n };\n\n return (\n <Stack spacing={1}>\n {chat.queue.map(({ id, content }) => (\n <Chip\n key={id}\n variant=\"outlined\"\n label={queuedText(content)}\n onDelete={() => chat.cancelQueued(id)}\n sx={{ alignSelf: \"flex-end\", maxWidth: \"80%\" }}\n />\n ))}\n <Paper\n component=\"form\"\n variant=\"outlined\"\n onSubmit={send}\n onKeyDown={sendOnEnter}\n sx={{ p: 1, borderRadius: 7, boxShadow: 2 }}\n >\n {files.length > 0 && (\n <Stack direction=\"row\" sx={{ flexWrap: \"wrap\", gap: 0.5, px: 1, pb: 1 }}>\n {files.map(({ name, part }, index) => (\n <Chip\n key={index}\n size=\"small\"\n label={name}\n avatar={\n part.type === \"image\" ? (\n <Avatar variant=\"rounded\" src={srcOf(part)} alt=\"\" />\n ) : undefined\n }\n onDelete={() => setFiles(files.filter((_, at) => at !== index))}\n />\n ))}\n </Stack>\n )}\n <Stack direction=\"row\" spacing={0.5} sx={{ alignItems: \"flex-end\" }}>\n <Tooltip title={t(\"Layout.Chat.NewChat\")}>\n <span>\n <IconButton\n aria-label=\"New chat\"\n onClick={() => void newChat()}\n disabled={!chat.messages.length}\n >\n <Add />\n </IconButton>\n </span>\n </Tooltip>\n <Tooltip title={t(\"Layout.Chat.Attach\")}>\n <IconButton aria-label=\"Attach files\" onClick={pick}>\n <AttachFile />\n </IconButton>\n </Tooltip>\n <InputBase\n value={draft}\n onChange={(event) => setDraft(event.target.value)}\n placeholder={t(\"Layout.Chat.Message\")}\n multiline\n maxRows={8}\n slotProps={{ input: { \"aria-label\": \"Ask anything\" } }}\n sx={{ flex: 1, py: 1, pl: 0.5 }}\n />\n {chat.isLoading && (\n <Tooltip title={t(\"Layout.Chat.Stop\")}>\n <IconButton aria-label=\"Stop\" onClick={chat.stop} sx={roundButtonSx}>\n <Stop />\n </IconButton>\n </Tooltip>\n )}\n {(!chat.isLoading || ready) && (\n <Tooltip title={t(\"Layout.Chat.Send\")}>\n <IconButton aria-label=\"Send\" type=\"submit\" sx={roundButtonSx}>\n <ArrowUpward />\n </IconButton>\n </Tooltip>\n )}\n </Stack>\n </Paper>\n </Stack>\n );\n}\n\ninterface ChatLayoutProps {\n chat: Chat;\n /** Styles the chat's root box, e.g. a background. */\n sx?: SxProps<Theme>;\n}\n\n/** The chat screen. Give it a parent with a height (e.g. `Fullscreen`). */\nexport function ChatLayout({ chat, sx }: Readonly<ChatLayoutProps>) {\n const { t } = useTranslation();\n const { alert } = useDialogs();\n const { ref, following } = useFollowContent();\n const [files, setFiles] = useState<Array<Attached>>([]);\n const last = chat.messages.at(-1);\n\n // Kept in the message for the model to read as it is: nothing is uploaded anywhere.\n const attach = async (added: Array<File>) => {\n for (const file of added) {\n try {\n const part = await fileToPart(file);\n setFiles((current) => [...current, { name: file.name, part }]);\n } catch {\n await alert(t(\"Layout.Chat.FileNotRead\", { name: file.name }));\n }\n }\n };\n // The whole chat takes a dropped or pasted file, and shows that only while one is dragged over it.\n const { getRootProps, getInputProps, isDragActive, open } = useDropzone({\n noClick: true,\n noKeyboard: true,\n onDrop: (dropped) => void attach(dropped),\n });\n // A delete waiting for approval is still running.\n const live = chat.isLoading || chat.interrupts.some(({ status }) => status === \"pending\");\n const runningTool = live\n ? last?.parts.findLast(\n (part): part is ToolCallPart =>\n part.type === \"tool-call\" &&\n part.output === undefined &&\n part.name !== \"show_ui\" &&\n part.name !== \"ask_user\",\n )\n : undefined;\n const status = isReasoning(chat)\n ? t(\"Layout.Chat.Reasoning\")\n : runningTool\n ? activityText(t, runningTool, true)\n : \"\";\n\n return (\n <Box\n {...getRootProps({ className: \"LayoutChat-root\" })}\n sx={[\n {\n position: \"relative\",\n display: \"flex\",\n flexDirection: \"column\",\n flex: 1,\n minHeight: 0,\n height: \"100%\",\n },\n ...(Array.isArray(sx) ? sx : [sx]),\n ]}\n >\n <input {...getInputProps()} />\n <Box ref={ref} sx={{ flex: 1, minHeight: 0, overflowY: \"auto\" }}>\n <Stack\n spacing={2.5}\n sx={{ ...columnSx, py: 3, [`& > .${statusClass} + .${statusClass}`]: { mt: 0.5 } }}\n >\n {chat.messages.map((message) => (\n <ChatMessage\n key={message.id}\n message={message}\n live={live && message === last}\n // A form answers only the newest question, once the reply has stopped streaming.\n canAnswer={!chat.isLoading && message === last}\n addToolResult={chat.addToolResult}\n />\n ))}\n <Approvals chat={chat} />\n {isReasoning(chat) && <Reasoning />}\n {chat.error && (\n <Alert\n severity=\"error\"\n action={\n <Tooltip title={t(\"Layout.Chat.Regenerate\")}>\n <IconButton\n aria-label=\"Regenerate\"\n color=\"inherit\"\n size=\"small\"\n onClick={() => void chat.reload()}\n >\n <Refresh fontSize=\"small\" />\n </IconButton>\n </Tooltip>\n }\n >\n {chat.error.message}\n </Alert>\n )}\n </Stack>\n </Box>\n <Box sx={{ ...columnSx, pb: 2 }}>\n <ChatInput\n chat={chat}\n files={files}\n setFiles={setFiles}\n pick={open}\n onSend={() => (following.current = true)}\n />\n </Box>\n {isDragActive && (\n <Box\n sx={{\n position: \"absolute\",\n inset: 8,\n zIndex: 2,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n border: 2,\n borderStyle: \"dashed\",\n borderColor: \"primary.main\",\n borderRadius: 4,\n bgcolor: \"background.paper\",\n opacity: 0.92,\n pointerEvents: \"none\",\n }}\n >\n <Typography color=\"primary\">{t(\"Layout.Chat.DropFiles\")}</Typography>\n </Box>\n )}\n {/* Mounted empty and kept, so screen readers announce every new status line. */}\n <Box role=\"status\" sx={visuallyHidden}>\n {status}\n </Box>\n </Box>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA8DA,SAAgB,YAAA,IAAoE;;CAAxD,MAAA,EAAE,MAAM,SAAS,YAAjBA;CAC1B,MAAM,EAAE,MAAM,eAAe;CAC7B,MAAM,YAAY,MAAM;CAOXC,IAAAA;CAAM,IAAA,EAAA,OAAA,SAAA;EAAN,WAAM,QAAQ;EAAR,EAAA,KAAA;;;C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AY;OAC1C,eAAe,KAAK;MAAA,GALf,QAAQ,EAKO,CAEvB;MACD,oBAAC,WAAD,EAAiB,KAAA,CAAA;MAChB,YAAY,IAAI,KAAK,oBAAC,WAAD,CAAC,CAAA;MACtB,KAAK,SACJ,oBAAC,OAAD;OACE,UAAA;OACA,QACE,oBAAC,SAAD;QAAS,OAAO,EAAE,wBAAwB;QACxC,UAAA,oBAAC,YAAD;SACE,cAAA;SACA,OAAA;SACA,MAAA;SACA,eAAe,KAAK,KAAK,OAAO;SAEhC,UAAA,oBAAC,SAAD,EAAS,UAAA,QAAA,CAAA;QACT,CAAA;OACF,CAAA;OAGH,UAAA,KAAK,MAAM;MACZ,CAAA;KAEJ;;GACF,CAAA;GACF,oBAAC,KAAD;IAAK,IAAI;KAAE,GAAG;KAAU,IAAI;IAAE;IAC5B,UAAA,oBAAC,WAAD;KACQ;KACC;KACG;KACV,MAAM;KACN,cAAe,UAAU,UAAU;IAAA,CAAA;GAErC,CAAA;GACD,gBACC,oBAAC,KAAD;IACE,IAAI;KACF,UAAU;KACV,OAAO;KACP,QAAQ;KACR,SAAS;KACT,YAAY;KACZ,gBAAgB;KAChB,QAAQ;KACR,aAAa;KACb,aAAa;KACb,cAAc;KACd,SAAS;KACT,SAAS;KACT,eAAe;IACjB;IAEA,UAAA,oBAAC,YAAD;KAAY,OAAA;KAAiB,UAAA,EAAE,uBAAuB;IAAI,CAAA;GAC1D,CAAA;GAGJ,oBAAC,KAAD;IAAK,MAAA;IAAc,IAAI;IACpB,UAAA;GACD,CAAA;EACF;;AAEN"}
@@ -1,4 +1,4 @@
1
- import z from "zod";
1
+ import z, { z as z$1 } from "zod";
2
2
  declare const ApprovalSchema: z.ZodObject<{
3
3
  id: z.ZodUUID;
4
4
  number: z.ZodString;
@@ -369,5 +369,22 @@ declare const EmployeeSchema: z.ZodObject<{
369
369
  supervisorRecordNumber: z.ZodNumber;
370
370
  }, z.core.$strip>;
371
371
  type Employee = z.infer<typeof EmployeeSchema>;
372
- export { Approval as a, ApproveApprovalSchema as c, CreateApproval as d, CreateApprovalSchema as f, WithdrawApprovalSchema as g, WithdrawApproval as h, DepartmentSchema as i, CancelApproval as l, ResubmitApprovalSchema as m, EmployeeSchema as n, ApprovalSchema as o, ResubmitApproval as p, Department as r, ApproveApproval as s, Employee as t, CancelApprovalSchema as u };
373
- //# sourceMappingURL=Employee-C8xIlBxY.d.mts.map
372
+ declare const ExtractFileSchema: z$1.ZodObject<{
373
+ appName: z$1.ZodString;
374
+ fileId: z$1.ZodUUID;
375
+ fields: z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{
376
+ type: z$1.ZodDefault<z$1.ZodEnum<{
377
+ boolean: "boolean";
378
+ date: "date";
379
+ number: "number";
380
+ string: "string";
381
+ }>>;
382
+ description: z$1.ZodString;
383
+ }, z$1.core.$strip>>;
384
+ instructions: z$1.ZodOptional<z$1.ZodString>;
385
+ }, z$1.core.$strip>;
386
+ type ExtractFile = z$1.infer<typeof ExtractFileSchema>;
387
+ /** Each field's value, keyed by its name: `null` when the file does not show it, dates as YYYY-MM-DD. */
388
+ type FileExtraction = Record<string, string | number | boolean | null>;
389
+ export { ResubmitApprovalSchema as _, EmployeeSchema as a, Approval as c, ApproveApprovalSchema as d, CancelApproval as f, ResubmitApproval as g, CreateApprovalSchema as h, Employee as i, ApprovalSchema as l, CreateApproval as m, ExtractFileSchema as n, Department as o, CancelApprovalSchema as p, FileExtraction as r, DepartmentSchema as s, ExtractFile as t, ApproveApproval as u, WithdrawApproval as v, WithdrawApprovalSchema as y };
390
+ //# sourceMappingURL=ExtractFile-ClTc-e1H.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RouterListItemButton-CF-8w-08.mjs","names":["<IconButton ref={reference} component=\"a\" {...props} />","<CreatedComponent {...props} />","Component","_c","CreatedComponent","<ListItemButton ref={reference} component=\"a\" {...props} />","<CreatedComponent {...props} />","_c"],"sources":["../src/components/router/RouterIconButton.tsx","../src/components/router/RouterListItemButton.tsx"],"sourcesContent":["import { IconButton } from \"@mui/material\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { IconButtonProps } from \"@mui/material\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLAnchorElement, IconButtonProps<\"a\">>(\n function IconButtonComponent(props, reference) {\n return <IconButton ref={reference} component=\"a\" {...props} />;\n },\n);\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterIconButton: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};\n","import { ListItemButton } from \"@mui/material\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { ListItemButtonProps } from \"@mui/material\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLAnchorElement, ListItemButtonProps<\"a\">>(\n function ButtonComponent(props, reference) {\n return <ListItemButton ref={reference} component=\"a\" {...props} />;\n },\n);\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterListItemButton: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};\n"],"mappings":";;;;;;AAMA,MAAME,cAAY,MAAM,WACtB,SAAS,oBAAoB,OAAO,WAAW;;CACtCF,IAAAA;CAA8C,IAAA,EAAA,OAAA,SAAA,EAAA,OAA7B,WAAA;EAAjB,KAAA,oBAAC,YAAD;GAAY,KAAK;GAAW,WAAA;GAAc,GAAI;EAAK,CAAA;EAAL,EAAA,KAAA;EAA7B,EAAA,KAAA;;;CAAxB,OAAOA;AACT,CACF;AAEA,MAAMI,qBAAmB,WAAWF,WAAS;AAE7C,MAAa,oBAAqD,UAAU;;CACnED,IAAAA;CAAsB,IAAA,EAAA,OAAA,OAAA;EAAtB,KAAA,oBAACG,oBAAD,EAAkB,GAAI,MAAK,CAAA;EAAL,EAAA,KAAA;;;CAA7B,OAAOH;AACT;;ACVA,MAAM,YAAY,MAAM,WACtB,SAAS,gBAAgB,OAAO,WAAW;;CAClCI,IAAAA;CAAkD,IAAA,EAAA,OAAA,SAAA,EAAA,OAA7B,WAAA;EAArB,KAAA,oBAAC,gBAAD;GAAgB,KAAK;GAAW,WAAA;GAAc,GAAI;EAAK,CAAA;EAAL,EAAA,KAAA;EAA7B,EAAA,KAAA;;;CAA5B,OAAOA;AACT,CACF;AAEA,MAAM,mBAAmB,WAAW,SAAS;AAE7C,MAAa,wBAAyD,UAAU;;CACvEC,IAAAA;CAAsB,IAAA,EAAA,OAAA,OAAA;EAAtB,KAAA,oBAAC,kBAAD,EAAkB,GAAI,MAAK,CAAA;EAAL,EAAA,KAAA;;;CAA7B,OAAOA;AACT"}
1
+ {"version":3,"file":"RouterListItemButton-CF-8w-08.mjs","names":["<IconButton ref={reference} component=\"a\" {...props} />","<CreatedComponent {...props} />","Component","CreatedComponent","<ListItemButton ref={reference} component=\"a\" {...props} />","<CreatedComponent {...props} />"],"sources":["../src/components/router/RouterIconButton.tsx","../src/components/router/RouterListItemButton.tsx"],"sourcesContent":["import { IconButton } from \"@mui/material\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { IconButtonProps } from \"@mui/material\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLAnchorElement, IconButtonProps<\"a\">>(\n function IconButtonComponent(props, reference) {\n return <IconButton ref={reference} component=\"a\" {...props} />;\n },\n);\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterIconButton: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};\n","import { ListItemButton } from \"@mui/material\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { ListItemButtonProps } from \"@mui/material\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLAnchorElement, ListItemButtonProps<\"a\">>(\n function ButtonComponent(props, reference) {\n return <ListItemButton ref={reference} component=\"a\" {...props} />;\n },\n);\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterListItemButton: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};\n"],"mappings":";;;;;;AAMA,MAAME,cAAY,MAAM,WACtB,SAAS,oBAAoB,OAAO,WAAW;;CACtCF,IAAAA;CAA8C,IAAA,EAAA,OAAA,SAAA,EAAA,OAA7B,WAAA;EAAjB,KAAA,oBAAC,YAAD;GAAY,KAAK;GAAW,WAAA;GAAc,GAAI;EAAK,CAAA;EAAL,EAAA,KAAA;EAA7B,EAAA,KAAA;;;CAAxB,OAAOA;AACT,CACF;AAEA,MAAMG,qBAAmB,WAAWD,WAAS;AAE7C,MAAa,oBAAqD,UAAU;;CACnED,IAAAA;CAAsB,IAAA,EAAA,OAAA,OAAA;EAAtB,KAAA,oBAACE,oBAAD,EAAkB,GAAI,MAAK,CAAA;EAAL,EAAA,KAAA;;;CAA7B,OAAOF;AACT;;ACVA,MAAM,YAAY,MAAM,WACtB,SAAS,gBAAgB,OAAO,WAAW;;CAClCG,IAAAA;CAAkD,IAAA,EAAA,OAAA,SAAA,EAAA,OAA7B,WAAA;EAArB,KAAA,oBAAC,gBAAD;GAAgB,KAAK;GAAW,WAAA;GAAc,GAAI;EAAK,CAAA;EAAL,EAAA,KAAA;EAA7B,EAAA,KAAA;;;CAA5B,OAAOA;AACT,CACF;AAEA,MAAM,mBAAmB,WAAW,SAAS;AAE7C,MAAa,wBAAyD,UAAU;;CACvEC,IAAAA;CAAsB,IAAA,EAAA,OAAA,OAAA;EAAtB,KAAA,oBAAC,kBAAD,EAAkB,GAAI,MAAK,CAAA;EAAL,EAAA,KAAA;;;CAA7B,OAAOA;AACT"}
@@ -0,0 +1,24 @@
1
+ import z, { z as z$1 } from "zod";
2
+ declare const EmailSchema: z.ZodObject<{
3
+ subject: z.ZodString;
4
+ body: z.ZodString;
5
+ to: z.ZodArray<z.ZodEmail>;
6
+ bcc: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
7
+ cc: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
8
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
9
+ appName: z.ZodString;
10
+ subId: z.ZodUUID;
11
+ }, z.core.$strip>>>;
12
+ }, z.core.$strip>;
13
+ type Email = z.infer<typeof EmailSchema>;
14
+ declare const TranslateSchema: z$1.ZodObject<{
15
+ text: z$1.ZodString;
16
+ languages: z$1.ZodArray<z$1.ZodString>;
17
+ }, z$1.core.$strip>;
18
+ type Translate = z$1.infer<typeof TranslateSchema>;
19
+ /** The text in each requested language, keyed by its code, and the code it is `detected` in. */
20
+ type Translation = {
21
+ detected: string;
22
+ } & Record<string, string>;
23
+ export { EmailSchema as a, Email as i, TranslateSchema as n, Translation as r, Translate as t };
24
+ //# sourceMappingURL=Translate-Ad784Dps.d.mts.map
@@ -183,6 +183,26 @@ const WithdrawApprovalSchema = z.object({
183
183
  comment: z.string().trim().min(1).max(2e3),
184
184
  emailBody: z.string().trim().min(1)
185
185
  });
186
- export { ResubmitApprovalSchema as a, ApprovalStatus as c, ApprovalFlowSchema as d, ApprovalEmployeeSchema as f, ApprovalCoRequestorSchema as h, CreateApprovalSchema as i, ApprovalFlowStepSchema as l, ApprovalCoRequestorPrincipalSchema as m, ApproveApprovalSchema as n, WithdrawApprovalSchema as o, ApprovalCoRequestorPermissionsSchema as p, CancelApprovalSchema as r, HqApprovalRequestSchema as s, ApprovalSchema as t, ApprovalStepResult as u };
186
+ // src/models/layout/ExtractFile.ts
187
+ const ExtractFileSchema = z$1.object({
188
+ appName: z$1.string().min(1).max(255),
189
+ fileId: z$1.uuid(),
190
+ fields: z$1.record(z$1.string().regex(/^[A-Za-z][A-Za-z0-9_]{0,63}$/), z$1.object({
191
+ type: z$1.enum([
192
+ "string",
193
+ "number",
194
+ "boolean",
195
+ "date"
196
+ ]).default("string"),
197
+ description: z$1.string().trim().min(1).max(1e3)
198
+ }), { error: (issue) => issue.code === "invalid_key" ? "names must start with a letter and use only letters, digits and _" : void 0 }).refine((fields) => Object.keys(fields).length > 0 && Object.keys(fields).length <= 50, { message: "expected 1 to 50 fields" }),
199
+ instructions: z$1.string().trim().max(4e3).optional()
200
+ });
201
+ // src/models/layout/Translate.ts
202
+ const TranslateSchema = z$1.object({
203
+ text: z$1.string().trim().min(1).max(4e3),
204
+ languages: z$1.array(z$1.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$/)).min(1).max(20)
205
+ });
206
+ export { ApprovalCoRequestorSchema as _, CancelApprovalSchema as a, WithdrawApprovalSchema as c, ApprovalFlowStepSchema as d, ApprovalStepResult as f, ApprovalCoRequestorPrincipalSchema as g, ApprovalCoRequestorPermissionsSchema as h, ApproveApprovalSchema as i, HqApprovalRequestSchema as l, ApprovalEmployeeSchema as m, ExtractFileSchema as n, CreateApprovalSchema as o, ApprovalFlowSchema as p, ApprovalSchema as r, ResubmitApprovalSchema as s, TranslateSchema as t, ApprovalStatus as u };
187
207
 
188
- //# sourceMappingURL=Approval-D1TfISUL.mjs.map
208
+ //# sourceMappingURL=Translate-BiCjnlyx.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Translate-BiCjnlyx.mjs","names":["z","z","z","z","z","z","z"],"sources":["../src/models/approval/ApprovalCoRequestor.ts","../src/models/approval/ApprovalEmployee.ts","../src/models/approval/StepApprovalOrder.ts","../src/models/approval/ApprovalFlow.ts","../src/models/approval/ApprovalStepResult.ts","../src/models/approval/ApprovalFlowStep.ts","../src/models/approval/ApprovalRequestType.ts","../src/models/approval/ApprovalStatus.ts","../src/models/approval/HqApprovalRequest.ts","../src/models/approval/Approval.ts","../src/models/layout/ExtractFile.ts","../src/models/layout/Translate.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const ApprovalCoRequestorGroupSchema = z.object({\n role: z.string().trim().min(1),\n email: z.email(),\n});\n\nexport type ApprovalCoRequestorGroup = z.infer<typeof ApprovalCoRequestorGroupSchema>;\n\nexport const ApprovalCoRequestorEmployeeSchema = z.object({\n employeeId: z.string().trim().min(1),\n name: z.string().trim().min(1),\n email: z.email(),\n});\n\nexport type ApprovalCoRequestorEmployee = z.infer<typeof ApprovalCoRequestorEmployeeSchema>;\n\nexport const ApprovalCoRequestorPrincipalSchema = z.union([\n ApprovalCoRequestorGroupSchema,\n ApprovalCoRequestorEmployeeSchema,\n]);\n\nexport type ApprovalCoRequestorPrincipal = z.infer<typeof ApprovalCoRequestorPrincipalSchema>;\n\nexport const ApprovalCoRequestorPermissionsSchema = z.object({\n withdraw: z.boolean().default(false).optional(),\n cancel: z.boolean().default(false).optional(),\n});\n\nexport type ApprovalCoRequestorPermissions = z.infer<typeof ApprovalCoRequestorPermissionsSchema>;\n\nexport const ApprovalCoRequestorSchema = z.object({\n id: z.uuid(),\n principal: ApprovalCoRequestorPrincipalSchema,\n permissions: ApprovalCoRequestorPermissionsSchema,\n});\n\nexport type ApprovalCoRequestor = z.infer<typeof ApprovalCoRequestorSchema>;\n","import { z } from \"zod\";\n\nexport const ApprovalEmployeeSchema = z.object({\n employeeId: z.string().trim().min(1).max(20),\n name: z.string().trim().min(1).max(50),\n email: z.email().min(1).max(100),\n});\n\nexport type ApprovalEmployee = z.infer<typeof ApprovalEmployeeSchema>;\n\nexport const ApprovalProxySchema = z.object({\n proxy: ApprovalEmployeeSchema,\n});\n\nexport type ApprovalProxy = z.infer<typeof ApprovalProxySchema>;\n","import z from \"zod\";\n\nexport const StepApprovalOrder = z.enum([\"Serial\", \"Parallel\", \"OneOfThem\"]);\n","import { z } from \"zod\";\nimport { StepApprovalOrder } from \"./StepApprovalOrder\";\nimport type { ApprovalFlowStep } from \"./ApprovalFlowStep\";\n\nexport const ApprovalFlowSchema = z.object({\n id: z.uuid(),\n approvalStage: z.number(),\n batchSequence: z.number().optional(),\n approvalSequence: z.number(),\n stepApprovalOrder: StepApprovalOrder,\n steps: z.array(z.custom<ApprovalFlowStep>()),\n isActive: z.boolean().default(false).optional(),\n});\n\nexport type ApprovalFlow = z.infer<typeof ApprovalFlowSchema>;\n","import z from \"zod\";\n\nexport const ApprovalStepResult = z.enum([\n \"NotAvailable\",\n \"FutureApproval\",\n \"WaitingForApproval\",\n \"Approved\",\n \"Rejected\",\n \"Skipped\",\n \"Withdrawn\",\n \"Cancelled\",\n]);\n","import { z } from \"zod\";\nimport { ApprovalEmployeeSchema, ApprovalProxySchema } from \"./ApprovalEmployee\";\nimport { ApprovalStepResult } from \"./ApprovalStepResult\";\n\nexport const ApprovalFlowStepSchema = z.object({\n id: z.uuid(),\n order: z.number(),\n approverRole: z.string().trim().min(1).max(100).default(\"Approver\").optional(),\n approver: ApprovalEmployeeSchema,\n actualApprover: ApprovalEmployeeSchema.optional(),\n proxies: z.array(ApprovalProxySchema),\n result: ApprovalStepResult.default(\"NotAvailable\").optional(),\n resultDate: z.date().optional(),\n resultComment: z.string().trim().max(2000).optional(),\n});\n\nexport type ApprovalFlowStep = z.infer<typeof ApprovalFlowStepSchema>;\n","import z from \"zod\";\n\nexport const ApprovalRequestType = z.enum([\"Single\", \"Batch\"]);\n","import z from \"zod\";\n\nexport const ApprovalStatus = z.enum([\n \"WaitingForApproval\",\n \"Approved\",\n \"Rejected\",\n \"Withdrawn\",\n \"Cancelled\",\n]);\n","import { z } from \"zod\";\n\nexport const HqApprovalColSchema = z.object({\n title: z.string().optional(),\n text: z.string().optional(),\n textColor: z.string().optional(),\n textSize: z.string().optional(),\n});\n\nexport type HqApprovalCol = z.infer<typeof HqApprovalColSchema>;\n\nexport const HqApprovalRowSchema = z.object({\n col: z.array(HqApprovalColSchema),\n});\n\nexport type HqApprovalRow = z.infer<typeof HqApprovalRowSchema>;\n\nexport const HqApprovalSectionSchema = z.object({\n row: z.array(HqApprovalRowSchema),\n title: z.string().optional(),\n type: z.string().optional(),\n text: z.string().optional(),\n});\n\nexport type HqApprovalSection = z.infer<typeof HqApprovalSectionSchema>;\n\nexport const HqApprovalPageSchema = z.object({\n section: z.array(HqApprovalSectionSchema),\n});\n\nexport type HqApprovalPage = z.infer<typeof HqApprovalPageSchema>;\n\nexport const HqApprovalSummarySchema = z.object({\n page: z.array(HqApprovalPageSchema),\n});\n\nexport type HqApprovalSummary = z.infer<typeof HqApprovalSummarySchema>;\n\nexport const HqApprovalFormDataSchema = z.object({\n systemId: z.string().optional(),\n formType: z.string().optional(),\n formId: z.string().optional(),\n stepName: z.string().optional(),\n userId: z.string().optional(),\n title: z.string().optional(),\n subject: z.string().optional(),\n summary: HqApprovalSummarySchema.optional(),\n messageId: z.string().optional(),\n attachList: z.string().optional(),\n chkResult: z.string().optional(),\n apprSummary: z.string().optional(),\n approvalComment: z.string().optional(),\n});\n\nexport type HqApprovalFormData = z.infer<typeof HqApprovalFormDataSchema>;\n\nexport const HqApprovalHeaderSchema = z.object({\n serviceId: z.string().optional(),\n authorizationCode: z.string().optional(),\n dataCreatedTime: z.string().optional(),\n characterEnable: z.boolean().default(false).optional(),\n});\n\nexport type HqApprovalHeader = z.infer<typeof HqApprovalHeaderSchema>;\n\nexport const HqApprovalRequestSchema = z.object({\n header: HqApprovalHeaderSchema.optional(),\n formData: HqApprovalFormDataSchema.optional(),\n});\n\nexport type HqApprovalRequest = z.infer<typeof HqApprovalRequestSchema>;\n","import z from \"zod\";\nimport { ApprovalCoRequestorSchema } from \"./ApprovalCoRequestor\";\nimport {\n type ApprovalEmployee,\n ApprovalEmployeeSchema,\n ApprovalProxySchema,\n} from \"./ApprovalEmployee\";\nimport type { ApprovalFlow } from \"./ApprovalFlow\";\nimport { ApprovalFlowSchema } from \"./ApprovalFlow\";\nimport { ApprovalFlowStepSchema } from \"./ApprovalFlowStep\";\nimport { ApprovalRequestType } from \"./ApprovalRequestType\";\nimport { ApprovalStatus } from \"./ApprovalStatus\";\nimport { ApprovalStepResult } from \"./ApprovalStepResult\";\nimport { HqApprovalRequestSchema } from \"./HqApprovalRequest\";\n\nexport const ApprovalSchema = z.object({\n id: z.uuid(),\n number: z.string().trim().min(1).max(30),\n applicationName: z.string().trim().min(1).max(50),\n type: ApprovalRequestType.default(\"Single\").optional(),\n status: ApprovalStatus,\n created: z.date(),\n createdBy: z.custom<ApprovalEmployee>(),\n updated: z.date().optional(),\n updatedBy: z.custom<ApprovalEmployee>().optional(),\n approvalFlows: z.array(z.custom<ApprovalFlow>()).min(1),\n currentApprovers: z.array(\n ApprovalEmployeeSchema.extend({ proxies: z.array(ApprovalProxySchema) }),\n ),\n coRequestors: z.array(ApprovalCoRequestorSchema).optional(),\n});\n\nexport type Approval = z.infer<typeof ApprovalSchema>;\n\n// Create Approval\nexport const CreateApprovalSchema = ApprovalSchema.pick({\n id: true,\n number: true,\n applicationName: true,\n type: true,\n status: true,\n approvalFlows: true,\n}).extend({\n emailBody: z.string().trim().min(1),\n hqApprovalRequest: HqApprovalRequestSchema.optional(),\n approvalFlows: z\n .array(\n ApprovalFlowSchema.pick({\n approvalStage: true,\n batchSequence: true,\n stepApprovalOrder: true,\n steps: true,\n }).extend({\n steps: z\n .array(\n ApprovalFlowStepSchema.pick({\n approverRole: true,\n approver: true,\n }),\n )\n .min(1),\n }),\n )\n .min(1),\n coRequestors: z.array(ApprovalCoRequestorSchema).optional(),\n});\n\nexport type CreateApproval = z.infer<typeof CreateApprovalSchema>;\n\n// Single Approval\nexport const ApproveApprovalSchema = z.object({\n id: z.uuid(),\n result: ApprovalStepResult,\n resultComment: z.string().trim().max(2000).optional(),\n emailBody: z.string().trim().min(1),\n});\n\nexport type ApproveApproval = z.infer<typeof ApproveApprovalSchema>;\n\n// Resubmit Approval\nexport const ResubmitApprovalSchema = ApprovalSchema.pick({\n id: true,\n approvalFlows: true,\n}).extend({\n emailBody: z.string().trim().min(1),\n approvalFlows: z\n .array(\n ApprovalFlowSchema.pick({\n approvalStage: true,\n batchSequence: true,\n stepApprovalOrder: true,\n steps: true,\n }).extend({\n steps: z\n .array(\n ApprovalFlowStepSchema.pick({\n approverRole: true,\n approver: true,\n }),\n )\n .min(1),\n }),\n )\n .min(1),\n});\n\nexport type ResubmitApproval = z.infer<typeof ResubmitApprovalSchema>;\n\n// Cancel Approval\nexport const CancelApprovalSchema = z.object({\n id: z.uuid(),\n comment: z.string().trim().min(1).max(2000),\n emailBody: z.string().trim().min(1),\n});\n\nexport type CancelApproval = z.infer<typeof CancelApprovalSchema>;\n\n// Withdraw Approval\nexport const WithdrawApprovalSchema = z.object({\n id: z.uuid(),\n comment: z.string().trim().min(1).max(2000),\n emailBody: z.string().trim().min(1),\n});\n\nexport type WithdrawApproval = z.infer<typeof WithdrawApprovalSchema>;\n","import { z } from \"zod\";\n\nexport const ExtractFileSchema = z.object({\n appName: z.string().min(1).max(255),\n fileId: z.uuid(),\n // The field names become the keys of the extraction.\n fields: z\n .record(\n z.string().regex(/^[A-Za-z][A-Za-z0-9_]{0,63}$/),\n z.object({\n type: z.enum([\"string\", \"number\", \"boolean\", \"date\"]).default(\"string\"),\n description: z.string().trim().min(1).max(1000),\n }),\n {\n error: (issue) =>\n issue.code === \"invalid_key\"\n ? \"names must start with a letter and use only letters, digits and _\"\n : undefined,\n },\n )\n .refine((fields) => Object.keys(fields).length > 0 && Object.keys(fields).length <= 50, {\n message: \"expected 1 to 50 fields\",\n }),\n instructions: z.string().trim().max(4000).optional(),\n});\n\nexport type ExtractFile = z.infer<typeof ExtractFileSchema>;\n\n/** Each field's value, keyed by its name: `null` when the file does not show it, dates as YYYY-MM-DD. */\nexport type FileExtraction = Record<string, string | number | boolean | null>;\n","import { z } from \"zod\";\n\nexport const TranslateSchema = z.object({\n text: z.string().trim().min(1).max(4000),\n // BCP 47 tags such as en, cs or zh-TW; they become the fields of the translation.\n languages: z\n .array(z.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$/))\n .min(1)\n .max(20),\n});\n\nexport type Translate = z.infer<typeof TranslateSchema>;\n\n/** The text in each requested language, keyed by its code, and the code it is `detected` in. */\nexport type Translation = { detected: string } & Record<string, string>;\n"],"mappings":";;AAEA,MAAa,iCAAiCA,IAAE,OAAO;CACrD,MAAMA,IAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;CAC7B,OAAOA,IAAE,MAAM;AACjB,C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GAAC;GAAU;GAAU;GAAW;EAAM,CAAC,CAAC,CAAC,QAAQ,QAAQ;EACtE,aAAaA,IAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAI;CAChD,CAAC,GACD,EACE,QAAQ,UACN,MAAM,SAAS,gBACX,sEACA,KAAA,EACR,CACF,CAAC,CACA,QAAQ,WAAW,OAAO,KAAK,MAAM,CAAC,CAAC,SAAS,KAAK,OAAO,KAAK,MAAM,CAAC,CAAC,UAAU,IAAI,EACtF,SAAS,0BACX,CAAC;CACH,cAAcA,IAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,GAAI,CAAC,CAAC,SAAS;AACrD,CAAC;;ACtBD,MAAa,kBAAkBC,IAAE,OAAO;CACtC,MAAMA,IAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAI;CAEvC,WAAWA,IACR,MAAMA,IAAE,OAAO,CAAC,CAAC,MAAM,kCAAkC,CAAC,CAAC,CAC3D,IAAI,CAAC,CAAC,CACN,IAAI,EAAE;AACX,CAAC"}
package/dist/ai.d.mts ADDED
@@ -0,0 +1,36 @@
1
+ import { n as User } from "./User-aJksXItw.mjs";
2
+ import { RunAgentInput } from "@tanstack/ai/client";
3
+ import { OpenAIChatCompletionsTextAdapter, OpenAIChatModel } from "@tanstack/ai-openai";
4
+ import { AnyServerTool } from "@tanstack/ai";
5
+ /**
6
+ * The one adapter for the Wistron AI gateway: conversations, one-off calls and files. Create it
7
+ * per request in a server function (`getAppToken` caches the token).
8
+ *
9
+ * Chat Completions, not Responses: the gateway load-balances Azure deployments, and Responses
10
+ * replays encrypted reasoning that other deployments cannot read (400 invalid_encrypted_content).
11
+ */
12
+ export declare const chatAdapter: <TModel extends OpenAIChatModel>(model: TModel) => Promise<OpenAIChatCompletionsTextAdapter<TModel>>;
13
+ interface LayoutChatOptions {
14
+ /** The request the chat sent: the server function's `data`. */
15
+ data: RunAgentInput;
16
+ /** Who the assistant acts for: `context.user` of `authMiddleware()`. */
17
+ user: User;
18
+ /** What the app is, what its records are called and where their pages are. The same for every user. */
19
+ systemPrompts: Array<string>;
20
+ /**
21
+ * The app's server tools. One marked `needsApproval` stays a tool call, which the chat confirms
22
+ * with the user first; the others become the functions of the programs the model runs, so it
23
+ * filters, joins and changes many records in one go, and only its answer enters the conversation.
24
+ */
25
+ tools?: ReadonlyArray<AnyServerTool>;
26
+ /** How the app works: markdown by topic, each starting with a `# Title` line. Read on demand. */
27
+ guides?: Record<string, string>;
28
+ }
29
+ /**
30
+ * The reply to a chat request, streamed: return it from the server function given to
31
+ * `createLayoutChatHook`. It runs the app's tools as the signed-in user and brings what every
32
+ * assistant shares: the model, code mode, the guides, the shared rules and a bounded conversation.
33
+ */
34
+ export declare function layoutChat({ data, user, systemPrompts, tools, guides }: LayoutChatOptions): Promise<Response>;
35
+ export {};
36
+ //# sourceMappingURL=ai.d.mts.map