{"version":3,"file":"80530.f734cefb.js","sources":["webpack://app/./src/components/blocks/TaskProgress.module.scss?f089","webpack://app/./src/components/CodeEditor.tsx","webpack://app/./src/components/SimpleTextarea.tsx","webpack://app/./src/components/UserPopover.tsx","webpack://app/./src/components/blocks/TaskBlock.tsx","webpack://app/./src/components/blocks/TaskDuration.tsx","webpack://app/./src/components/blocks/TaskProgressBar.tsx","webpack://app/./src/components/code-plan/Planner.tsx","webpack://app/./src/components/code-plan/SVGPlan.tsx","webpack://app/./src/components/editors/monaco/DiffEditor.tsx","webpack://app/./src/components/editors/monaco/FileList.tsx","webpack://app/./src/components/editors/monaco/ReviewHistory.tsx","webpack://app/./src/components/editors/monaco/hooks/useGeneralReviewComment.tsx","webpack://app/./src/components/editors/monaco/hooks/useReviewDiffComments.tsx","webpack://app/./src/components/editors/monaco/hooks/useReviewHistory.tsx","webpack://app/./src/components/editors/monaco/monacoInitializer.ts","webpack://app/./src/components/modals/TaskStatusDetailsModal.tsx","webpack://app/./src/components/modals/base/HeaderContent.tsx","webpack://app/./src/components/modals/base/BaseModal.tsx","webpack://app/./src/components/tree-view/TreeView.tsx","webpack://app/./src/hooks/conversation/useConversationMetadata.tsx","webpack://app/./src/hooks/conversation/useConversationUuid.tsx","webpack://app/./src/hooks/conversation/useConversations.ts","webpack://app/./src/hooks/conversation/useMessages.tsx","webpack://app/./src/hooks/organization/useOrgUsers.tsx","webpack://app/./src/hooks/super-admin/useAdminConversation.tsx","webpack://app/./src/hooks/task/useCodePlan.tsx","webpack://app/./src/hooks/task/useTaskBlock.tsx","webpack://app/./src/hooks/task/useTaskDoc.tsx","webpack://app/./src/hooks/task/useTaskId.ts","webpack://app/./src/hooks/task/useTaskLastUpdted.tsx","webpack://app/./src/hooks/task/useTaskObj.tsx","webpack://app/./src/hooks/useModal.tsx","webpack://app/./src/i18n/declaration.ts","webpack://app/./src/store/editorSlice.ts","webpack://app/./src/store/modalSlice.ts","webpack://app/./src/types/TabOption.tsx","webpack://app/./src/utils/ssr.ts","webpack://app/../storybook/components/CurieInput.tsx","webpack://app/../storybook/components/buttons/PrimaryButton.tsx"],"sourcesContent":["// extracted by css-extract-rspack-plugin\nexport default {\"progress\":\"progress-Y3ddK4\"};","import { cn } from '@nextui-org/react'\nimport { useState } from 'react'\nimport DiffEditor, { DiffEditorProps } from '~/components/editors/monaco/DiffEditor'\nimport FileList from '~/components/editors/monaco/FileList'\nimport {\n useConversationMetadata,\n useConversationUuid,\n useIsInternalUploadedIndex,\n useIsLocalSyncIndex\n} from '~/hooks'\nimport { useIsS3Task } from '~/hooks/task/useS3Task'\nimport { useTaskBlock } from '~/hooks/task/useTaskBlock'\nimport { CommandType, Diff } from '~/protos/agents'\nimport { applyDiff } from '~/services/taskService'\nimport { TabOption } from '~/types/TabOption'\nimport { AppEvents, globalEventEmitter } from '~/utils/shared'\nimport { BetterToast } from '~/utils/toast'\nimport { TaskBlock, TaskBlockProps } from './blocks'\n\ninterface CodeEditorProps {\n initialDiffs: Diff[] | null\n readOnly?: boolean\n}\n\nfunction CodeEditor({ initialDiffs, readOnly = false }: CodeEditorProps): JSX.Element {\n const uuid = useConversationUuid()\n const [diffs, setDiffs] = useState(initialDiffs ?? null)\n const [activeDiff, setActiveDiff] = useState(diffs?.[0] ?? null)\n const isS3Task = useIsS3Task()\n const taskBlock = useTaskBlock()\n const isInternalUploadedIndex = useIsInternalUploadedIndex()\n const isLocalSyncIndex = useIsLocalSyncIndex()\n const { command } = useConversationMetadata()\n const isMulesoftToCamel = command === CommandType.MULESOFT_TO_CAMEL_MIGRATION\n const isReadOnly =\n isS3Task || readOnly || isInternalUploadedIndex || isLocalSyncIndex || isMulesoftToCamel\n\n const onContentChange: DiffEditorProps['onContentChange'] = ({ fileContent }) => {\n setDiffs(\n diffs?.map(diff => (diff === activeDiff ? { ...diff, bFileContent: fileContent } : diff)) ??\n null\n )\n }\n\n const onAcceptDiff = async () => {\n if (Array.isArray(diffs)) {\n await applyDiff({ uuid, diffs })\n BetterToast.success('Diff applied')\n globalEventEmitter.emit(AppEvents.setActiveTab, TabOption.HELP)\n }\n }\n\n return (\n
\n {isReadOnly && taskBlock ? (\n \n ) : null}\n \n\n \n
\n )\n}\n\nexport default CodeEditor\n","import { cn } from '@nextui-org/react'\nimport type { KeyboardEvent } from 'react'\nimport { forwardRef, useCallback, useState } from 'react'\nimport { useSimpleTextareaClassName } from '~/hooks'\nimport { AppEvents, globalEventEmitter } from '~/utils/shared'\nimport { cm } from '~/utils/utils'\nimport { CurieTextarea } from './chat/ChatInput'\n\ninterface SimpleTextareaProps {\n className?: string\n onChange?: (value: string) => void\n enter2Submit?: boolean\n minRows?: number\n maxRows?: number\n placeholder?: string\n autoFocus?: boolean\n value?: string\n defaultValue?: string\n inputClassName?: string\n onBlur?: () => void\n}\n\nexport const SimpleTextarea = forwardRef(\n (\n {\n className,\n onChange,\n enter2Submit = false,\n minRows = 13,\n maxRows = 13,\n placeholder = 'Type a message...',\n autoFocus = false,\n value,\n defaultValue,\n inputClassName: userInputClassName,\n onBlur\n },\n forwardedRef\n ) => {\n const { className: inputClassName, ref: innerRef } = useSimpleTextareaClassName({\n rows: minRows\n })\n const [isComposing, setIsComposing] = useState(false)\n\n const onKeyPress = (event: KeyboardEvent) => {\n if (event.key === 'Enter' && !event.shiftKey && !isComposing && enter2Submit) {\n event.preventDefault() // prevent a new line\n globalEventEmitter.emit(AppEvents.SubmitTask)\n }\n }\n\n const refCallback = useCallback(\n (textareaElement: HTMLTextAreaElement | null) => {\n innerRef.current = textareaElement\n if (typeof forwardedRef === 'function') {\n forwardedRef(textareaElement)\n } else if (forwardedRef) {\n forwardedRef.current = textareaElement\n }\n },\n [forwardedRef]\n )\n\n return (\n onChange?.(e.currentTarget.value)}\n onKeyDown={onKeyPress}\n onCompositionStart={() => setIsComposing(true)}\n onCompositionEnd={() => setIsComposing(false)}\n placeholder={placeholder}\n maxRows={maxRows}\n minRows={minRows}\n ref={refCallback}\n onBlur={() => onBlur?.()}\n classNames={{\n inputWrapper: 'shadow-sm ring-1 ring-[#d4dce2]',\n input: cm('curie-input pr-4', inputClassName, userInputClassName)\n \n }}\n />\n )\n }\n)\n","import { Popover, PopoverContent, PopoverTrigger } from '@nextui-org/react'\nimport { useEffect, useState } from 'react'\nimport { useOrgUsers } from '~/hooks'\nimport { User } from '~/types/ResponseType'\nimport { generateAvatar } from '~/utils/utils'\n\ninterface UserPopoverProps {\n userId: number\n userName: string\n}\n\nexport function UserPopover({ userName, userId }: UserPopoverProps) {\n const [isOpen, setIsOpen] = useState(false)\n const [user, setUser] = useState()\n const users = useOrgUsers()\n\n if (!userName || !userId) {\n return null\n }\n\n const handleMouseEnter = () => {\n setIsOpen(true)\n }\n\n const handleMouseLeave = () => {\n setIsOpen(false)\n }\n\n useEffect(() => {\n const userInfo = users.find(user => user.id === userId)\n\n setUser({\n name: userInfo?.name,\n email: userInfo?.email,\n role: userInfo?.role\n } as User)\n }, [userId, users])\n\n return (\n setIsOpen(open)}>\n \n \n {userName}\n \n \n \n
\n
\n \n
\n
\n
{user?.name ?? 'Unkown'}
\n {user?.email ? (\n
{user?.email}
\n ) : null}\n
\n
\n \n
\n )\n}\n","import dayjs from 'dayjs'\nimport duration from 'dayjs/plugin/duration'\nimport { UsedCommandType } from '~/constants/commands'\nimport { useConversationUuid, useTaskId } from '~/hooks'\nimport { useConversationMetadata } from '~/hooks/conversation/useConversationMetadata'\nimport { useTaskProgress } from '~/hooks/task/useTaskProgress'\nimport { AgentTaskStatus, agentTaskStatusFromJSON, agentTaskStatusToJSON } from '~/protos/agents'\nimport { toCamelCase } from '~/utils/shared'\nimport { cm, verifyUUID } from '~/utils/utils'\nimport { TaskBlockHeader } from './TaskBlockHeader'\nimport { TaskDuration } from './TaskDuration'\nimport { TaskProgressBar } from './TaskProgressBar'\n\ndayjs.extend(duration)\n\nexport interface TaskBlockProps {\n children: Block[]\n fields: {\n task_id: number\n status: keyof typeof AgentTaskStatus\n title: string\n created_time: number\n }\n}\n\nexport const getStatusText = (status: string) => {\n if (status === agentTaskStatusToJSON(AgentTaskStatus.AGENT_INTERNAL_STATUS)) {\n return 'In Progress'\n }\n return toCamelCase(status)\n}\n\nexport const renderStatusBadge = (status: string) => {\n return (\n \n {getStatusText(status)}\n \n )\n}\n\nexport function TaskBlock({ fields }: TaskBlockProps) {\n const uuid = useConversationUuid()\n if (!verifyUUID(uuid)) return null\n const progress = useTaskProgress()\n const { command, branch } = useConversationMetadata()\n const taskId = useTaskId()\n\n return (\n
\n
\n \n
\n \n
\n
\n
\n {dayjs(fields.created_time).format('YYYY-MM-DD HH:mm')}\n
\n \n
\n
\n
\n
\n )\n}\n","import { MdAccessTime } from '@react-icons/all-files/md/MdAccessTime'\nimport dayjs from 'dayjs'\nimport { useEffect, useState } from 'react'\nimport { useTaskLastUpdated } from '~/hooks'\nimport { useTerminatedStatus } from '~/hooks/task/useTerminatedStatus'\n\ninterface TaskDurationProps {\n createdTime: number\n}\n\nexport function TaskDuration({ createdTime }: TaskDurationProps) {\n const taskLastUpdatedAt = useTaskLastUpdated()\n const [latestTime, setLatestTime] = useState(createdTime)\n const isTerminatedStatus = useTerminatedStatus()\n\n useEffect(() => {\n const timer = setInterval(() => {\n setLatestTime(Date.now())\n }, 1000)\n return () => {\n clearInterval(timer)\n }\n }, [])\n\n const lastUpdated = isTerminatedStatus ? taskLastUpdatedAt : latestTime\n const duration = dayjs.duration(dayjs(lastUpdated).diff(dayjs(createdTime)))\n\n const hours = duration.hours()\n const minutes = duration.minutes()\n const seconds = Math.max(duration.seconds(), 0)\n const durationInStr =\n (hours > 0 ? `${hours}h ` : '') + (minutes > 0 ? `${minutes}min ` : '') + `${seconds}s`\n\n return (\n
\n \n {durationInStr}\n
\n )\n}\n","import { TaskStatuses } from '~/constants/task-status'\nimport { useTerminatedStatus } from '~/hooks/task/useTerminatedStatus'\nimport { AgentTaskStatus, agentTaskStatusToJSON } from '~/protos/agents'\nimport { cm } from '~/utils/utils'\nimport { getStatusText } from './TaskBlock'\nimport styles from './TaskProgress.module.scss'\n\ninterface TaskProgressBarProps {\n percentage: number\n taskStatus: AgentTaskStatus\n statusText?: boolean\n}\nexport function TaskProgressBar({\n percentage,\n taskStatus,\n statusText = false\n}: TaskProgressBarProps) {\n const status = TaskStatuses[taskStatus]\n const isTerminatedStatus = useTerminatedStatus(status.id)\n\n let statusColor = status.color\n if (isTerminatedStatus) {\n statusColor = TaskStatuses[AgentTaskStatus.COMPLETED].color\n }\n\n return (\n
\n
\n
\n {percentage.toFixed(0)}%{' '}\n {statusText ? getStatusText(agentTaskStatusToJSON(taskStatus)) : ''}\n
\n \n )\n}\n","import { Button, Checkbox } from '@nextui-org/react'\nimport { FaListOl } from '@react-icons/all-files/fa6/FaListOl'\nimport { VscListOrdered } from '@react-icons/all-files/vsc/VscListOrdered'\nimport { useEffect, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useCodePlan, useConversationUuid, useTaskStatus } from '~/hooks'\nimport { I18nKey } from '~/i18n/declaration'\nimport { AgentTaskStatus, CodePlan, DiffType, diffTypeToJSON } from '~/protos/agents'\nimport { approvePlan } from '~/services/taskService'\nimport { BetterToast } from '~/utils/toast'\nimport { cm } from '~/utils/utils'\nimport { CurieMarkdown } from '../markdown'\nimport { SVGPlan } from './SVGPlan'\n\nexport interface CodePlanViewerProps {\n codePlan?: CodePlan\n readOnly?: boolean\n}\n\ninterface PlannerProps {\n readOnly: boolean\n}\n\nexport function CodePlanViewer({ codePlan, readOnly = false }: CodePlanViewerProps): JSX.Element {\n const uuid = useConversationUuid()\n const [isSubmitPlanDisabled, setIsSubmitPlanDisabled] = useState(false)\n const { t } = useTranslation()\n const [selectedFileNames, setSelectedFileNames] = useState(\n codePlan?.fileMultiSelect?.selectedFileNames || []\n )\n const taskStatus = useTaskStatus()\n const isReadOnly = AgentTaskStatus.PLANNING_COMPLETED !== taskStatus || readOnly\n\n const { svgFlows = [] } = codePlan || {}\n\n const onSubmitPlan = async () => {\n setIsSubmitPlanDisabled(true)\n const editedPlan = JSON.parse(JSON.stringify(codePlan)) as CodePlan\n editedPlan!.fileMultiSelect!.selectedFileNames = selectedFileNames\n await approvePlan({ uuid, codePlan: editedPlan })\n BetterToast.success('Plan submitted')\n }\n\n useEffect(() => {\n if (isSubmitPlanDisabled) {\n setIsSubmitPlanDisabled(false)\n }\n }, [uuid])\n\n useEffect(() => {\n const selectedFileNames = codePlan?.fileMultiSelect?.selectedFileNames\n if (Array.isArray(selectedFileNames)) {\n setSelectedFileNames(selectedFileNames)\n }\n }, [codePlan])\n\n const renderPlan = () => {\n const changeTypeColors = {\n [DiffType.MODIFY]: 'text-[#eb5325]',\n [DiffType.ADD]: 'text-[#2e7d32]',\n [DiffType.DELETE]: 'text-[#d32f2f]',\n [DiffType.DIFF_UNKNOWN_TYPE]: 'text-gray-700'\n }\n const { selectedFileNames } = codePlan!.fileMultiSelect!\n const allOptions = codePlan!.fileMultiSelect!.options\n const options = isReadOnly\n ? allOptions.filter(option => selectedFileNames.includes(option.fileName))\n : allOptions\n\n return options.map(option => {\n const changeTypeClass =\n changeTypeColors[option.fileChangeType as keyof typeof changeTypeColors]\n if (svgFlows.length) {\n return (\n \n )\n }\n\n return (\n
\n
\n
\n {isReadOnly ? null : (\n {\n setSelectedFileNames(prev => {\n if (evnet.target.checked) {\n return [...prev, option.fileName]\n } else {\n return prev.filter(name => name !== option.fileName)\n }\n })\n }}\n />\n )}\n \n {diffTypeToJSON(option.fileChangeType)}\n
\n \n {option.fileName}\n
\n
\n \n \n \n )\n })\n }\n\n return codePlan ? (\n
\n {renderPlan()}\n {isReadOnly || svgFlows.length > 0 ? null : (\n
\n \n Approve\n \n
\n )}\n
\n ) : (\n
\n \n {t(I18nKey.PLANNER$EMPTY_MESSAGE)}\n
\n )\n}\n\nconst Planner: React.FC = ({ readOnly: readonly }): JSX.Element => {\n const codePlan = useCodePlan()\n return (\n
\n
\n
\n \n
Plan
\n
\n
\n
\n \n
\n
\n
\n
\n )\n}\n\nexport default Planner\n","import { Button } from '@nextui-org/react'\nimport { useEffect, useState } from 'react'\nimport { useConversationUuid, useTaskStatus } from '~/hooks'\nimport { AgentTaskStatus, CodePlan } from '~/protos/agents'\nimport { approvePlan, regeneratePlan } from '~/services/taskService'\nimport { svg2base64 } from '~/utils/shared'\nimport { cm } from '~/utils/utils'\nimport { CurieMarkdown } from '../markdown'\n\ninterface SVGPlanProps {\n svgFlows: string[]\n hideSubmitButton: boolean\n codePlan?: CodePlan\n}\n\nexport function SVGPlan({ svgFlows, hideSubmitButton, codePlan }: SVGPlanProps): JSX.Element {\n const [isApproving, setIsApproving] = useState(false)\n const [isRegenerating, setIsRegenerating] = useState(false)\n const uuid = useConversationUuid()\n const taskStatus = useTaskStatus()\n\n const onRegeneratePlan = async () => {\n setIsRegenerating(true)\n await regeneratePlan({ uuid })\n }\n const onApprovePlan = async () => {\n setIsApproving(true)\n await approvePlan({ uuid, codePlan })\n }\n\n useEffect(() => {\n if (taskStatus === AgentTaskStatus.PLANNING_COMPLETED) {\n setIsApproving(false)\n setIsRegenerating(false)\n }\n }, [taskStatus])\n\n const imageBase64 = svg2base64(svgFlows[0])\n const isDisabled =\n isApproving || isRegenerating || taskStatus === AgentTaskStatus.PLANNING_REREQUESTED\n return (\n
\n \n {hideSubmitButton ? null : (\n
\n \n Regenerate\n \n \n Approve\n \n
\n )}\n
\n )\n}\n","import { PrimaryButton, SecondaryButton } from '@curie/react'\nimport { Popover, PopoverContent, PopoverTrigger, useDisclosure } from '@nextui-org/react'\nimport { VscCode } from '@react-icons/all-files/vsc/VscCode'\nimport { t } from 'i18next'\nimport React, { memo, useCallback, useEffect, useRef, useState } from 'react'\nimport { useConversationUuid, useReviewDiffCommentsWithRef } from '~/hooks'\nimport { I18nKey } from '~/i18n/declaration'\nimport { Diff } from '~/protos/agents'\nimport { DiffComment } from '~/store/editorSlice'\nimport { AppEvents, globalEventEmitter } from '~/utils/shared'\n\nimport * as monaco from 'monaco-editor'\nimport { SimpleTextarea } from '~/components/SimpleTextarea'\nimport { getMonacoOptions, initializeMonaco } from './monacoInitializer'\n\nexport interface DiffEditorProps {\n diff: Diff | null\n onContentChange: (file: { filePath: string; fileContent: string }) => void\n readOnly?: boolean\n}\n\nlet codelensDisposable: monaco.IDisposable | null = null\nawait initializeMonaco()\n\nconst DiffEditorComponent: React.FC = ({ diff, onContentChange, readOnly }) => {\n const isCodelensRegistered = useRef(false)\n const cursorLocatorRef = useRef(null)\n const commentModalPayloadRef = useRef | null>(null)\n const diffEditorRef = useRef(null)\n const diffEditorElementRef = useRef(null)\n const monacoOptions = getMonacoOptions(readOnly)\n\n const {\n isOpen: isReviewModalOpen,\n onOpen: onReviewModalOpen,\n onClose: onReviewModalClose,\n onOpenChange: onReviewModalOpenChange\n } = useDisclosure()\n\n const handleResize = useCallback(() => {\n if (diffEditorRef.current) {\n diffEditorRef.current.layout()\n }\n }, [])\n\n const [comments, upsertComment, commentsRef] = useReviewDiffCommentsWithRef(diff?.bFilePath)\n\n useEffect(() => {\n if (diff != null) {\n const diffEditorElement = diffEditorElementRef.current!\n const containerElement = diffEditorElement.firstChild as HTMLDivElement\n const original = monaco.editor.createModel(diff!.aFileContent, 'xml')\n const modified = monaco.editor.createModel(diff!.bFileContent, 'xml')\n const diffEditor = monaco.editor.createDiffEditor(containerElement, monacoOptions)\n diffEditorRef.current = diffEditor\n\n const language = diff.bFilePath.split('.').pop() ?? 'xml'\n monaco.editor.setModelLanguage(original, language)\n monaco.editor.setModelLanguage(modified, language)\n\n diffEditor.setModel({ original, modified })\n const resizeObserver = new ResizeObserver(() => {\n diffEditor.layout()\n })\n resizeObserver.observe(diffEditorElement)\n window.addEventListener('resize', handleResize)\n\n return () => {\n // resizeObserver.disconnect()\n // window.removeEventListener('resize', handleResize)\n // diffEditor.dispose()\n // original.dispose()\n // modified.dispose()\n // diffEditorRef.current = null\n }\n }\n }, [diff, diffEditorElementRef])\n\n useEffect(() => {\n const diffEditorElement = diffEditorElementRef.current\n\n if (diff != null && diffEditorElement != null && diffEditorRef.current != null) {\n const diffEditor = diffEditorRef.current!\n const containerElement = diffEditorElement!.firstChild as HTMLDivElement\n const modifiedModel = diffEditor.getModifiedEditor().getModel()\n\n const addCommentId = diffEditor.addCommand(\n 0,\n (ctx, selection: monaco.Selection) => {\n const modifiedEditor = diffEditor.getModifiedEditor()\n const startPosition = selection.getStartPosition()\n const endPosition = selection.getEndPosition()\n const range = new monaco.Range(\n startPosition.lineNumber,\n 1,\n endPosition.lineNumber,\n Infinity\n )\n const endPositionPlusOne = new monaco.Position(\n endPosition.lineNumber,\n endPosition.column + 1\n )\n const position = modifiedEditor.getScrolledVisiblePosition(endPositionPlusOne)\n\n if (position) {\n const { top, left } = position\n const container = modifiedEditor.getDomNode()!\n const rootRect = containerElement.getBoundingClientRect()\n const containerRect = container.getBoundingClientRect()\n\n const baseTop = rootRect.top - containerRect.top\n const baseLeft = rootRect.width - containerRect.width\n\n const relativeTop = baseTop + top\n const relativeLeft = baseLeft + left\n\n if (cursorLocatorRef.current) {\n cursorLocatorRef.current.style.top = `${relativeTop}px`\n cursorLocatorRef.current.style.left = `${relativeLeft}px`\n }\n\n setCommentText('')\n commentModalPayloadRef.current = {\n filePath: diff!.bFilePath,\n fileContent: modifiedEditor.getModel()!.getValueInRange(range),\n startLineNumber: startPosition.lineNumber,\n endLineNumber: endPosition.lineNumber\n }\n onReviewModalOpen()\n }\n },\n ''\n )!\n\n const editCommentId = diffEditor.addCommand(\n 0,\n (ctx, comment: DiffComment) => {\n const modifiedEditor = diffEditor.getModifiedEditor()\n const range = new monaco.Range(\n comment.startLineNumber,\n 1,\n comment.endLineNumber,\n Infinity\n )\n const endPositionPlusOne = new monaco.Position(comment.endLineNumber + 1, 1)\n const position = modifiedEditor.getScrolledVisiblePosition(endPositionPlusOne)\n\n if (position) {\n const { top, left } = position\n const container = modifiedEditor.getDomNode()!\n const rootRect = containerElement.getBoundingClientRect()\n const containerRect = container.getBoundingClientRect()\n\n const baseTop = rootRect.top - containerRect.top\n const baseLeft = rootRect.width - containerRect.width\n\n const relativeTop = baseTop + top\n const relativeLeft = baseLeft + left\n\n if (cursorLocatorRef.current) {\n cursorLocatorRef.current.style.top = `${relativeTop}px`\n cursorLocatorRef.current.style.left = `${relativeLeft}px`\n }\n\n setCommentText(comment.comment)\n commentModalPayloadRef.current = {\n filePath: diff!.bFilePath,\n fileContent: modifiedEditor.getModel()!.getValueInRange(range),\n startLineNumber: comment.startLineNumber,\n endLineNumber: comment.endLineNumber\n }\n onReviewModalOpen()\n }\n },\n ''\n )!\n\n const getLineRangeText = (startLineNumber: number, endLineNumber: number): string => {\n return startLineNumber === endLineNumber\n ? `line ${startLineNumber}`\n : `line ${startLineNumber}-${endLineNumber}`\n }\n\n const truncateText = (text: string, limit: number = 60): string => {\n return text.length > limit ? text.slice(0, limit) + '...' : text\n }\n\n const highlightCommentLines = (\n comments: DiffComment[],\n diffEditor: monaco.editor.IStandaloneDiffEditor\n ) => {\n const decorations: monaco.editor.IModelDeltaDecoration[] = []\n\n for (const comment of comments) {\n decorations.push({\n range: new monaco.Range(comment.startLineNumber, 1, comment.endLineNumber, 1),\n options: {\n isWholeLine: true,\n className: 'comment-highlight'\n }\n })\n }\n\n diffEditor.getModifiedEditor().deltaDecorations([], decorations)\n }\n\n const updateCodeLenses = (comments: DiffComment[]) => {\n if (codelensDisposable) codelensDisposable.dispose()\n const selections = diffEditor.getModifiedEditor().getSelections() || []\n\n const lenses: monaco.languages.CodeLens[] = []\n for (const comment of comments) {\n const rangeText = getLineRangeText(comment.startLineNumber, comment.endLineNumber)\n const truncatedComment = truncateText(comment.comment)\n\n lenses.push({\n range: {\n startLineNumber: comment.startLineNumber,\n startColumn: 1,\n endLineNumber: comment.endLineNumber,\n endColumn: 1\n },\n id: editCommentId,\n command: {\n id: editCommentId,\n title: `${truncatedComment} | Edit comment (${rangeText})`,\n arguments: [comment]\n }\n })\n }\n\n for (const selection of selections) {\n const { startLineNumber, endLineNumber } = selection\n if (\n !comments.some(\n comment =>\n comment.startLineNumber === startLineNumber &&\n comment.endLineNumber === endLineNumber\n )\n ) {\n const rangeText = getLineRangeText(startLineNumber, endLineNumber)\n lenses.push({\n range: { startLineNumber, startColumn: 1, endLineNumber, endColumn: 1 },\n id: addCommentId,\n command: {\n id: addCommentId,\n title: `Leave a comment (${rangeText})`,\n arguments: [selection] as Array\n }\n })\n }\n }\n\n codelensDisposable = monaco.languages.registerCodeLensProvider('xml', {\n provideCodeLenses: model => {\n if (model === modifiedModel) {\n return { lenses, dispose() {} }\n }\n return { lenses: [], dispose() {} }\n },\n resolveCodeLens: (_, codeLens) => codeLens\n })\n }\n\n if (!readOnly) {\n modifiedModel?.onDidChangeContent(() => {\n const newFileContent = modifiedModel.getValue()\n onContentChange({\n filePath: diff?.bFilePath ?? '',\n fileContent: newFileContent\n })\n })\n\n if (!isCodelensRegistered.current) {\n isCodelensRegistered.current = true\n diffEditor.getModifiedEditor().onDidChangeCursorPosition(() => {\n updateCodeLenses(commentsRef.current)\n })\n globalEventEmitter.on(AppEvents.ReviewCommentsUpdated, comments => {\n updateCodeLenses(commentsRef.current)\n highlightCommentLines(commentsRef.current, diffEditor)\n })\n }\n }\n\n return () => {\n // diffEditor.dispose()\n // original.dispose()\n // modified.dispose()\n }\n }\n }, [diff, diffEditorElementRef])\n\n useEffect(() => {\n globalEventEmitter.emit(AppEvents.ReviewCommentsUpdated, comments)\n }, [comments])\n\n const [commentText, setCommentText] = useState('')\n const uuid = useConversationUuid()\n\n const onComment = () => {\n if (commentModalPayloadRef.current != null) {\n const comment = Object.assign(commentModalPayloadRef.current, { comment: commentText })\n upsertComment(uuid, comment)\n setCommentText('')\n }\n onReviewModalClose()\n }\n\n return diff ? (\n //
\n
\n
\n \n \n
\n \n \n
\n \n
\n \n Cancel\n \n \n Comment\n \n
\n
\n
\n \n
\n ) : (\n
\n
\n \n
{t(I18nKey.CODE_EDITOR$LOADING_MESSAGE)}
\n
\n
\n )\n}\n\nexport default memo(\n DiffEditorComponent,\n (prevProps, nextProps) => JSON.stringify(prevProps) === JSON.stringify(nextProps)\n)\n","import { PrimaryButton, SecondaryButton } from '@curie/react'\nimport { Button, cn, Popover, PopoverContent, PopoverTrigger } from '@nextui-org/react'\nimport { createTwoFilesPatch } from 'diff'\nimport JSZip from 'jszip'\nimport React, { useState } from 'react'\nimport { PopoverNavDownIcon } from '~/components/icons'\nimport { useConversationMetadata, useConversationUuid, useTaskStatus } from '~/hooks'\nimport { AgentTaskStatus, CommandType, commandTypeToJSON, Diff, DiffType } from '~/protos/agents'\nimport { requestChanges } from '~/services/taskService'\nimport { BetterToast } from '~/utils/toast'\nimport { cm } from '~/utils/utils'\nimport { SimpleTextarea } from '../../SimpleTextarea'\nimport { useGeneralReviewComment, useReviewDiffCommentsWithRef } from './hooks'\nimport { ReviewHistory } from './ReviewHistory'\n\ninterface FileListProps {\n diffs: Diff[] | null\n activeDiff: Diff | null\n onSelectDiff: (diff: Diff) => void\n onAcceptDiff: () => void\n readOnly?: boolean\n fileListsOnly?: boolean\n}\n\nconst FileList: React.FC = ({\n diffs = null,\n activeDiff,\n onSelectDiff,\n onAcceptDiff,\n readOnly = false,\n fileListsOnly = false\n}) => {\n const [disabled, setIsDisabled] = React.useState(false)\n const taskStatus = useTaskStatus()\n const isDisabled = disabled || taskStatus !== AgentTaskStatus.DIFF_GENERATED\n const getLabel = (diffType: DiffType) => {\n switch (diffType) {\n case DiffType.MODIFY:\n return 'M'\n case DiffType.ADD:\n return 'U'\n case DiffType.DELETE:\n return 'D'\n default:\n return ''\n }\n }\n\n const getFilePath = (diff: Diff | null) => {\n if (diff == null) return ''\n return diff.diffType === DiffType.DELETE ? diff.aFilePath : diff.bFilePath\n }\n\n const renderLabel = (diff: Diff) => {\n const label = getLabel(diff.diffType)\n switch (diff.diffType) {\n case DiffType.ADD:\n return {label}\n case DiffType.MODIFY:\n return {label}\n case DiffType.DELETE:\n return {label}\n }\n }\n\n const handleRequestChanges = async () => {\n if (comment.length === 0 && comments.length === 0) {\n BetterToast.error('Comment is required')\n return\n }\n setIsDisabled(true)\n await requestChanges({\n uuid,\n diffReview: {\n generalDiffComment: comment,\n diffComments: comments\n }\n })\n BetterToast.success('Requested changes submitted')\n }\n\n const handleDownloadDiffPatch = async () => {\n const generateCombinedPatch = (diffs: Diff[]) =>\n diffs\n .map(diff =>\n createTwoFilesPatch(\n diff.aFilePath || '/dev/null',\n diff.bFilePath || '/dev/null',\n (diff.aFileContent || '').trimEnd(),\n (diff.bFileContent || '').trimEnd()\n )\n )\n .join('\\n')\n .trimEnd() + '\\n'\n\n if (!diffs) {\n BetterToast.error('No diffs to download')\n return\n }\n\n try {\n const patch = generateCombinedPatch(diffs)\n const blob = new Blob([patch], { type: 'text/plain' })\n const url = window.URL.createObjectURL(blob)\n const a = document.createElement('a')\n a.href = url\n a.download = 'diff.patch'\n document.body.appendChild(a)\n a.click()\n document.body.removeChild(a)\n window.URL.revokeObjectURL(url)\n } catch (error) {\n console.error('Error creating patch file:', error)\n BetterToast.error('Failed to create patch file')\n }\n }\n\n const handleDownloadZip = async () => {\n try {\n const zip = new JSZip()\n const folderA = zip.folder('original')\n const folderB = zip.folder('generated')\n\n const addFileToZip = (filePath: string, fileContent: string, targetFolder: JSZip | null) => {\n if (!targetFolder) return\n\n const pathSegments = filePath.split('/')\n const fileName = pathSegments.pop()\n let currentFolder = targetFolder\n\n pathSegments.forEach(segment => {\n currentFolder = currentFolder.folder(segment) ?? currentFolder\n })\n\n if (fileName && fileContent) {\n currentFolder.file(fileName, fileContent)\n }\n }\n\n diffs?.forEach(diff => {\n addFileToZip(diff.aFilePath, diff.aFileContent, folderA)\n addFileToZip(diff.bFilePath, diff.bFileContent, folderB)\n })\n\n const content = await zip.generateAsync({ type: 'blob' })\n const url = window.URL.createObjectURL(content)\n const a = document.createElement('a')\n a.href = url\n a.download = 'diffs.zip'\n a.click()\n window.URL.revokeObjectURL(url)\n\n BetterToast.success('Zip file downloaded successfully!')\n } catch (error) {\n console.error('Error creating zip file:', error)\n BetterToast.error('Failed to create zip file')\n }\n }\n\n const handleAcceptDiff = async () => {\n setIsDisabled(true)\n await onAcceptDiff()\n }\n const uuid = useConversationUuid()\n const [comment, setComment] = useGeneralReviewComment()\n const [comments] = useReviewDiffCommentsWithRef()\n\n const DownloadPopover = () => {\n const [isOpen, setIsOpen] = useState(false)\n return (\n
\n \n \n \n Download Options\n \n \n \n \n
\n \n Download Generated Code\n \n \n Download Diff Patch\n \n
\n
\n \n
\n )\n }\n\n const { mode } = useConversationMetadata()\n const isCodeEnhancer = mode === commandTypeToJSON(CommandType.GENERATE_SIMPLE_CODE_PR)\n const shouldDisableCodeReview = isCodeEnhancer ? false : true\n\n return (\n
\n {Array.isArray(diffs) ? (\n <>\n
\n {!readOnly && !fileListsOnly && (\n
Editor
\n )}\n
    \n {diffs.map((diff, index) => (\n onSelectDiff(diff)}\n className={cm(\n 'rounded-sm text-default-600 items-center p-1 cursor-pointer overflow-hidden',\n 'text-ellipsis hover:bg-[#f0f0f0]',\n getFilePath(diff) == getFilePath(activeDiff) ? 'bg-[#ededed]' : ''\n )}\n >\n {renderLabel(diff)}\n {getFilePath(diff)}\n \n ))}\n
\n \n {!readOnly && !fileListsOnly && (\n
\n {shouldDisableCodeReview ? null : (\n
\n setComment(uuid, value)}\n className='w-[328px]'\n />\n
\n )}\n\n
\n \n Approve\n \n {shouldDisableCodeReview ? null : (\n \n Request Changes\n \n )}\n
\n {shouldDisableCodeReview ? null : (\n
\n \n
\n )}\n
\n )}\n
\n \n ) : (\n
Loading files...
\n )}\n
\n )\n}\n\nexport default FileList\n","import groupBy from 'lodash/groupBy'\nimport { IFlatMetadata } from 'react-accessible-treeview/dist/TreeView/utils'\nimport { ControlledExpandedNode, ITreeNode } from '../../tree-view/TreeView'\nimport { useReviewHistory } from './hooks'\n\ninterface ReviewHistoryProps {\n title: string\n}\n\nexport function ReviewHistory({ title }: ReviewHistoryProps) {\n const reviewItems = useReviewHistory()\n\n return (\n
\n

{title}

\n
\n {\n let children = [\n { name: ' No inline comments', children: [] }\n ] as ITreeNode[]\n if (\n Array.isArray(item.review.diffComments) &&\n item.review.diffComments.length > 0\n ) {\n const inlineComments = groupBy(item.review.diffComments, 'filePath')\n children = Object.keys(inlineComments).map(filePath => {\n return {\n name: filePath || 'No file path',\n children: inlineComments[filePath].map(comment => {\n return {\n name: `${comment.startLineNumber}-${comment.endLineNumber}: ${comment.comment}`,\n children: []\n }\n })\n }\n }) as unknown as ITreeNode[]\n }\n return {\n name: item.review.generalDiffComment || 'No general comment',\n children\n }\n })\n }\n : null\n }\n />\n
\n
\n )\n}\n","import { useSelector } from 'react-redux'\nimport store, { RootState } from '~/store'\nimport { setGeneralDiffComment } from '~/store/editorSlice'\nimport { useConversationUuid } from '../../../../hooks/conversation/useConversationUuid'\n\nexport function useGeneralReviewComment() {\n const conversationUuid = useConversationUuid()\n const review = useSelector((state: RootState) => state.editor.reviews[conversationUuid])\n const setState = (uuid: string, comment: string) => {\n store.dispatch(setGeneralDiffComment({ uuid, generalDiffComment: comment }))\n }\n return [review?.generalDiffComment ?? '', setState] as const\n}\n","import { useEffect, useRef } from 'react'\nimport { useSelector } from 'react-redux'\nimport store, { RootState } from '~/store'\nimport { DiffComment, upsertDiffComment } from '~/store/editorSlice'\nimport { useConversationUuid } from '../../../../hooks/conversation/useConversationUuid'\n\nexport function useReviewDiffCommentsWithRef(filePath?: string) {\n const conversationUuid = useConversationUuid()\n const review = useSelector((state: RootState) => state.editor.reviews[conversationUuid])\n const addComment = (uuid: string, comment: DiffComment) => {\n store.dispatch(upsertDiffComment({ uuid, comment }))\n }\n const comments =\n review?.diffComments?.filter(comment => {\n if (filePath == null) return true\n return comment.filePath === filePath\n }) ?? []\n\n const commentsRef = useRef(comments)\n useEffect(() => {\n commentsRef.current = comments\n }, [comments])\n\n return [comments, addComment, commentsRef] as const\n}\n","import { AgentTaskStatus } from '~/protos/agents'\nimport { DiffReview } from '~/store/editorSlice'\nimport { useTaskObj } from '../../../../hooks/task/useTaskObj'\n\nexport interface ReviewHistoryItem {\n review: DiffReview\n ts: number\n}\n\nexport function useReviewHistory() {\n const taskObj = useTaskObj()\n const tuples =\n taskObj?.details.orderedStateResponses.filter(request => {\n return request.taskStatus === AgentTaskStatus.DIFF_COMMENT_ADDED\n }) ?? []\n\n const reviewItems: ReviewHistoryItem[] = []\n for (const tuple of tuples) {\n const { request } = tuple as { request: Partial }\n const item = { review: {} } as ReviewHistoryItem\n\n item.review.generalDiffComment =\n request.generalDiffComment ?? request?.diffComments?.[0]?.comment ?? 'No general comment'\n item.review.diffComments = request.diffComments ?? []\n item.ts = Number(tuple.createdTsSec) * 1000\n\n reviewItems.push(item)\n }\n\n return reviewItems\n}\n","import { shikiToMonaco } from '@shikijs/monaco'\nimport * as monaco from 'monaco-editor'\nimport { createHighlighter } from 'shiki'\n\nexport const initializeMonaco = async () => {\n const highlighter = await createHighlighter({\n langs: ['xml', 'markdown', 'yaml', 'toml', 'json', 'java', 'csv'],\n langAlias: {\n raml: 'yaml',\n dataweave: 'yaml',\n dwl: 'yaml',\n example: 'yaml',\n task: 'yaml'\n },\n themes: ['github-light', 'min-dark']\n })\n\n monaco.languages.register({ id: 'json' })\n monaco.languages.register({ id: 'xml' })\n monaco.languages.register({ id: 'dataweave' })\n monaco.languages.register({ id: 'dwl' })\n monaco.languages.register({ id: 'csv' })\n monaco.languages.register({ id: 'yaml' })\n\n shikiToMonaco(highlighter as any, monaco as any)\n}\n\nexport const MONACO_COMMON_OPTIONS = {\n minimap: { enabled: false },\n diffCodeLens: true,\n fontFamily: 'Menlo, Monaco, \"Courier New\", monospace',\n fontSize: 12,\n language: 'xml',\n theme: 'github-light',\n cursorBlinking: 'blink',\n cursorStyle: 'line',\n cursorWidth: 1,\n renderWhitespace: 'all',\n ignoreTrimWhitespace: false,\n renderControlCharacters: true,\n scrollbar: {\n vertical: 'hidden',\n horizontal: 'hidden',\n verticalScrollbarSize: 0,\n horizontalScrollbarSize: 0,\n alwaysConsumeMouseWheel: false\n },\n overviewRulerBorder: false,\n overviewRulerLanes: 0,\n wordWrap: 'on'\n} as monaco.editor.IStandaloneEditorConstructionOptions\n\nexport const getMonacoOptions = (\n readOnly = false\n): monaco.editor.IStandaloneEditorConstructionOptions => ({\n ...MONACO_COMMON_OPTIONS,\n readOnly\n})\n","import { cn } from '@nextui-org/react'\nimport { IoMdDownload } from '@react-icons/all-files/io/IoMdDownload'\nimport { PiMicrosoftExcelLogoLight } from '@react-icons/all-files/pi/PiMicrosoftExcelLogoLight'\nimport sha256 from 'crypto-js/sha256'\nimport { TaskStatusDetail, TaskStatusDetailType, TaskStatuses } from '~/constants/task-status'\nimport { useTaskObj } from '~/hooks'\nimport { ModalId, useModalController } from '~/hooks/useModal'\nimport {\n AgentTaskStatus,\n DocumentInlineComment,\n TaskStatusAndRequestResponseTuple\n} from '~/protos/agents'\nimport { csvToMarkdown } from '~/utils/shared'\nimport { cm } from '~/utils/utils'\nimport { CodePlanViewer } from '../code-plan/Planner'\nimport CodeEditor from '../CodeEditor'\nimport { CurieMarkdown } from '../markdown'\nimport { img as CurieMarkdownImg } from '../markdown/img'\nimport useAdminConversation from '~/hooks/super-admin/useAdminConversation'\n\nexport interface TaskStatusDetailModalProps extends TaskStatusDetail {\n title: string\n index: number\n taskStatus: AgentTaskStatus\n uuid?: string\n}\n\nexport const getCodePlanFromTupleRequest = (tuple: TaskStatusAndRequestResponseTuple) => {\n return tuple.request?.codePlan\n}\n\nexport const getCodePlanFromTupleResponse = (tuple: TaskStatusAndRequestResponseTuple) => {\n return tuple.response?.[0]?.responseContentStream?.codePlan\n}\n\nexport const getDiffFromTupleRequest = (tuple: TaskStatusAndRequestResponseTuple) => {\n return tuple.request?.diff || []\n}\n\nexport const getDiffFromTupleResponse = (tuple: TaskStatusAndRequestResponseTuple) => {\n return tuple.response?.[0]?.responseContentStream?.diff || []\n}\n\nexport const getDocumentFromTupleResponse = (tuple: TaskStatusAndRequestResponseTuple) => {\n const document = tuple.response?.[0]?.responseContentStream?.document\n\n if (document != null) {\n for (const [key, value] of Object.entries(document!)) {\n if (value == null || value == null || value === '') {\n continue\n }\n\n let md = ''\n if (key === 'mappingSheetCsv') {\n md = csvToMarkdown(value)\n } else {\n md = value\n }\n return md\n }\n }\n\n return tuple.response?.[0]?.responseContentStream?.munitScenarios?.mdText\n}\n\nexport const getCommentFromTupleRequest = (tuple: TaskStatusAndRequestResponseTuple) => {\n return tuple.request?.documentInlineComments?.[0] as DocumentInlineComment\n}\n\nexport const getDocumentWithCommentFromTupleRequest = (\n tuples: TaskStatusAndRequestResponseTuple[],\n index: number\n) => {\n const generatedTuple = tuples.findLast((tuple, tupleIndex) => {\n if (tupleIndex > index) {\n return false\n }\n return tuple.taskStatus === AgentTaskStatus.DOCUMENT_GENERATED\n })\n const comment = getCommentFromTupleRequest(tuples[index])\n return {\n markdown: getDocumentFromTupleResponse(generatedTuple!)!,\n comment: comment\n } as const\n}\n\nexport const getNewCodePlanFromTuples = (\n tuples: TaskStatusAndRequestResponseTuple[],\n index: number\n) => {\n const tuple = tuples[index]\n const completedTuple = tuples.findLast((tuple, tupleIndex) => {\n if (tupleIndex > index) {\n return false\n }\n return tuple.taskStatus === AgentTaskStatus.PLANNING_COMPLETED\n })\n if (completedTuple) {\n const originalCodePlan = getCodePlanFromTupleResponse(completedTuple)\n const editedCodePlan = getCodePlanFromTupleRequest(tuple)\n if (originalCodePlan && editedCodePlan) {\n const newCodePlan = JSON.parse(JSON.stringify(originalCodePlan))\n newCodePlan.fileMultiSelect!.selectedFileNames =\n editedCodePlan.fileMultiSelect!.selectedFileNames\n return newCodePlan\n }\n }\n}\n\nfunction highlightLines(markdown: string, startLine: number, endLine: number): string {\n const lines = markdown.split('\\n')\n\n if (startLine > 0 && startLine <= lines.length) {\n const highlightCount = endLine - startLine + 1\n lines[startLine - 1] = `# [!code warning:${highlightCount}]\\n${lines[startLine - 1]}`\n }\n\n return lines.join('\\n')\n}\n\nexport function TaskStatusDetailModal({ index, taskStatus, uuid }: TaskStatusDetailModalProps) {\n let taskObj = useTaskObj(uuid)\n const { closeModal } = useModalController(ModalId.TaskStatusDetails)\n \n if (!taskObj && !!uuid) {\n const conversation = useAdminConversation({ uuid })\n taskObj = conversation?.task\n }\n\n const tuples = taskObj?.details.orderedStateResponses ?? []\n const tuple = tuples[index]\n const isDiffTaskStatus = TaskStatuses[taskStatus].detailType === TaskStatusDetailType.DIFF\n\n let text: string | undefined = undefined\n let className = isDiffTaskStatus\n ? 'min-w-[1200px] min-h-[700px] max-h-[900px]'\n : 'w-auto min-h-[400px] max-h-[600px]'\n let description: string | undefined = undefined\n\n const renderUploadedImages = (task: TaskObject | null) => {\n const images = task?.details.originalRequest?.command?.images || []\n return images.length > 0 ? (\n
\n
Images Uploaded:
\n
\n {images.map((image, index) => {\n const imageUrl = `data:image/${image.imageExtension};base64,${image.imageBase64Content}`\n return (\n
\n \n
\n )\n })}\n
\n
\n ) : null\n }\n\n const renderUploadedSpreadsheets = (task: TaskObject | null) => {\n const spreadsheets = task?.details.originalRequest?.mappingSheet || []\n\n const handleDownload = (spreadsheet: { id: string; base64EncodedXlsx: string }) => {\n const blob = new Blob([Buffer.from(spreadsheet.base64EncodedXlsx, 'base64')], {\n type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\n })\n const url = window.URL.createObjectURL(blob)\n const a = document.createElement('a')\n a.href = url\n a.download = spreadsheet.id\n document.body.appendChild(a)\n a.click()\n document.body.removeChild(a)\n window.URL.revokeObjectURL(url)\n }\n\n return spreadsheets.length > 0 ? (\n
\n
Spreadsheet Uploaded:
\n
\n {spreadsheets.map((spreadsheet, index) => {\n const file = new File([spreadsheet.base64EncodedXlsx], spreadsheet.id)\n\n return (\n
\n \n
\n \n
\n \n {file.name}\n
\n
\n\n handleDownload(spreadsheet)}\n >\n \n
\n \n )\n })}\n \n \n ) : null\n }\n\n const renderDetail = () => {\n if (taskStatus === AgentTaskStatus.SUBMITTED) {\n text = taskObj?.details.originalRequest?.command?.commandString\n text = `\\`\\`\\`\\n${text}\\n\\`\\`\\``\n description = 'Task description:'\n return (\n <>\n {description ? (\n
\n {description}\n
\n ) : null}\n \n {renderUploadedImages(taskObj)}\n {renderUploadedSpreadsheets(taskObj)}\n \n )\n } else if (TaskStatuses[taskStatus].detailType === TaskStatusDetailType.PLAN) {\n if (AgentTaskStatus.PLANNING_COMPLETED === taskStatus) {\n return \n } else {\n const editedCodePlan = getNewCodePlanFromTuples(tuples, index)\n return editedCodePlan ? (\n \n ) : (\n \n )\n }\n } else if (TaskStatuses[taskStatus].detailType === TaskStatusDetailType.DIFF) {\n if (AgentTaskStatus.DIFF_GENERATED === taskStatus) {\n const initialDiffs = getDiffFromTupleResponse(tuple)\n const diffSha256 = sha256(JSON.stringify(initialDiffs)).toString()\n return (\n
\n \n
\n )\n } else {\n const generatedTuple = tuples.findLast((response, tupleIndex) => {\n if (tupleIndex > index) {\n return false\n }\n return response.taskStatus === AgentTaskStatus.DIFF_GENERATED\n })\n if (generatedTuple) {\n const initialDiffs = getDiffFromTupleResponse(generatedTuple)\n const diffSha256 = sha256(JSON.stringify(initialDiffs)).toString()\n return (\n
\n \n
\n )\n }\n }\n } else if (TaskStatuses[taskStatus].detailType === TaskStatusDetailType.DOC) {\n if (AgentTaskStatus.DOCUMENT_UPDATED === taskStatus) {\n const { markdown, comment } = getDocumentWithCommentFromTupleRequest(tuples, index)\n const highlighted = highlightLines(markdown, comment.startLineNumber, comment.endLineNumber)\n return (\n <>\n
\n User comment:\n
\n
\n {comment.comment}\n
\n \n \n )\n } else {\n const markdown = getDocumentFromTupleResponse(tuple) as string\n return \n }\n }\n }\n\n if (isDiffTaskStatus) {\n return renderDetail()\n }\n\n return (\n
\n
\n {renderDetail()}\n
\n {/*
\n \n Close\n \n
*/}\n
\n )\n}\n","import { ReactNode } from 'react'\n\ninterface HeaderContentProps {\n title: string | ReactNode\n subtitle?: string\n}\n\nexport function HeaderContent({ title, subtitle = undefined }: HeaderContentProps) {\n return (\n
\n

{title}

\n {subtitle && {subtitle}}\n
\n )\n}\n","import { Modal, ModalBody, ModalContent, ModalHeader } from '@nextui-org/react'\nimport { VscClose } from '@react-icons/all-files/vsc/VscClose'\nimport type { ReactNode } from 'react'\nimport { cm } from '~/utils/utils'\nimport { HeaderContent } from './HeaderContent'\n\ntype Size = 'md' | 'sm' | 'lg' | 'xl' | '2xl' | 'xs' | '3xl' | '4xl' | '5xl' | 'full'\ntype ScrollBehavior = 'normal' | 'inside' | 'outside'\ninterface BaseModalProps {\n isOpen: boolean\n onOpenChange: (isOpen: boolean) => void\n title: string | ReactNode\n isDismissable?: boolean\n size?: Size\n subtitle?: string\n children?: ReactNode\n scrollBehavior?: ScrollBehavior\n className?: string\n backdrop?: 'opaque' | 'transparent' | 'blur'\n parentRef?: React.RefObject\n headerBorder?: boolean\n contentClassName?: string\n bodyClassName?: string\n wrapperClassName?: string\n}\n\nfunction BaseModal({\n isOpen,\n onOpenChange,\n title,\n isDismissable = true,\n size = 'md',\n subtitle = undefined,\n children = null,\n scrollBehavior = 'normal',\n className = '',\n backdrop = 'opaque',\n parentRef,\n headerBorder = true,\n contentClassName = '',\n bodyClassName = '',\n wrapperClassName = ''\n}: BaseModalProps) {\n const portalContainer = parentRef?.current || document.body\n return (\n \n \n {closeModal => (\n <>\n \n \n
\n closeModal()}\n >\n \n
\n \n \n \n {children}\n \n \n )}\n \n \n )\n}\n\nexport default BaseModal\n","import { VscChevronDown } from '@react-icons/all-files/vsc/VscChevronDown'\nimport { VscChevronRight } from '@react-icons/all-files/vsc/VscChevronRight'\nimport TreeView, { flattenTree, NodeId } from 'react-accessible-treeview'\nimport { IFlatMetadata } from 'react-accessible-treeview/dist/TreeView/utils'\nimport { cm } from '~/utils/utils'\n\nexport interface ITreeNode {\n id?: NodeId\n name: string\n isBranch?: boolean\n children?: ITreeNode[]\n metadata?: M\n}\n\nexport function ControlledExpandedNode({ node }: { node: ITreeNode | null }) {\n return node ? (\n
\n {\n const color = Math.max(8 - level, 5)\n return (\n \n {isBranch && }\n {element.name}\n
\n )\n }}\n />\n \n ) : (\n
No review history yet
\n )\n}\n\ninterface ArrowIconProps {\n isOpen: boolean\n className?: string\n}\n\nconst ArrowIcon = ({ isOpen, className }: ArrowIconProps) => {\n const baseClass = 'arrow'\n const classes = cm(baseClass, className, 'mr-1')\n return isOpen ? : \n}\n","import { UsedCommandType } from '~/constants/commands'\nimport { CommandType, commandTypeFromJSON, commandTypeToJSON } from '~/protos/agents'\nimport { ConversationMetadata } from '~/types/Conversations'\nimport { isCampaignUuid } from '~/utils/utils'\nimport { useCampaignAgentType } from '../campaign'\nimport { useConversationUuid } from './useConversationUuid'\nimport { useConversations } from './useConversations'\n\nconst DEFAULT_QA_GUIDELINES = `\n- Ensure that constants are not hardcoded in the codebase.\n- Ensure that any passwords or secrets are not used in the codebase without being encrypted.\n- Comment if the new feature would break some existing functionality.\n- Ensure that common components like error handling, logging, configuration, dataweave, etc. are being reused without being rewritten.\n- The code style should be consistent with the codebase.\n- Ensure that the code is well tested and has unit tests for all the new functionality.\n- Check for common mistakes such as copying the same constants for different environments.\n- There should not be any unused code or variable in the project.\n- Use the latest connector version whenever possible.\n- Avoid logging the payload which might contain sensitive information and also impacts the performance.\n`.trim()\n\nexport function useConversationMetadata(uuid?: string) {\n const uuidToUse = useConversationUuid(uuid)\n\n if (isCampaignUuid(uuidToUse)) {\n return {\n command: useCampaignAgentType() as UsedCommandType\n }\n }\n const { conversations } = useConversations()\n const conversation = conversations.find(c => c.uuid === uuidToUse)\n const metadata = conversation?.conversation_metadata || {\n mode: commandTypeToJSON(CommandType.NONE),\n qa_guidelines: undefined\n }\n if (metadata.mode) {\n Object.assign(metadata, { command: commandTypeFromJSON(metadata.mode) as UsedCommandType })\n }\n if (metadata.qa_guidelines == null) {\n Object.assign(metadata, { qa_guidelines: DEFAULT_QA_GUIDELINES })\n }\n return metadata as Partial\n}\n","import useLocation from 'react-use/esm/useLocation'\n\nexport const useConversationUuid = (uuidToUse?: string) => {\n const { pathname = '' } = useLocation()\n const currentUuid = pathname.split('/').pop() || ''\n return uuidToUse || currentUuid\n}\n","import { useQuery } from '@tanstack/react-query'\nimport { getConversations } from '~/services/conversationService'\nimport { QueryKeys } from '~/services/queryClient'\nimport { Conversation } from '~/types/Conversations'\nimport { serverSideProps } from '~/utils/ssr'\nimport { getConversationsPaginated,ConversationsResponse } from '~/services/conversationService'\nimport { useInfiniteQuery } from '@tanstack/react-query'\n\n\nexport function useConversations() {\n const {\n data,\n fetchNextPage,\n hasNextPage,\n isFetching,\n error,\n status,\n } = useInfiniteQuery({\n queryKey: QueryKeys.Conversations,\n queryFn: ({ pageParam = 0 }) => getConversationsPaginated(pageParam as number),\n initialPageParam: 0,\n getNextPageParam: (lastPage) => {\n if (!lastPage || !lastPage.has_more) {\n return undefined;\n }\n return lastPage.next_cursor;\n },\n initialData: {\n pages: [\n {\n data: [],\n next_cursor: null,\n has_more: false,\n },\n ],\n pageParams: [0],\n }\n });\n const conversations = data\n ? data.pages.flatMap((page) => page.data || [])\n : [];\n\n return {\n conversations,\n fetchNextPage,\n hasNextPage,\n isFetching,\n error,\n status,\n };\n}","import { useSelector } from 'react-redux'\nimport { RootState } from '~/store'\nimport { useConversationUuid } from './useConversationUuid'\n\ninterface UseMessagesProps {\n uuid?: string | null\n}\n\nexport function useMessages({ uuid }: UseMessagesProps = {}) {\n const conversationUuid = useConversationUuid()\n const effectiveUuid = uuid ?? conversationUuid\n return useSelector((state: RootState) => state.chat.messages[effectiveUuid]) || []\n}\n","import { useQuery } from '@tanstack/react-query'\nimport { getOrgUsers } from '~/services/organizationService'\nimport { QueryKeys } from '~/services/queryClient'\nimport { ResOrgUser, User } from '~/types/ResponseType'\n\nexport function useOrgUsers() {\n const { data: users } = useQuery({\n queryKey: QueryKeys.OrgUsers,\n queryFn: getOrgUsers,\n initialData: [] as ResOrgUser[]\n })\n return users as ResOrgUser[]\n}\n","import { useQuery } from \"@tanstack/react-query\"\nimport { getConversationByUuid } from \"~/services/superAdminService\"\nimport { ConversationWithMessages } from '~/types/Conversations'\n\ninterface UseAdminConversationProps {\n uuid: string | null\n}\n\nconst useAdminConversation = ({\n uuid\n}: UseAdminConversationProps) => {\n const { data } = useQuery({\n queryKey: [uuid],\n queryFn: ({ queryKey }) => getConversationByUuid(queryKey[0] as string),\n initialData: null,\n enabled: !!uuid,\n meta: {\n persist: false\n },\n select: (data) => data as ConversationWithMessages\n })\n\n return data\n}\n\nexport default useAdminConversation\n","import {\n getCodePlanFromTupleResponse,\n getNewCodePlanFromTuples\n} from '~/components/modals/TaskStatusDetailsModal'\nimport { AgentTaskStatus } from '~/protos/agents'\nimport { useTaskObj } from './useTaskObj'\n\nexport function useCodePlan() {\n const taskObj = useTaskObj()\n\n const tuples = taskObj?.details.orderedStateResponses ?? []\n const completedTuple = tuples.findLast(response => {\n return response.taskStatus === AgentTaskStatus.PLANNING_COMPLETED\n })\n\n if (completedTuple) {\n const index = tuples.findLastIndex(response => {\n return [\n AgentTaskStatus.PLANNING_COMPLETED,\n AgentTaskStatus.PLANNING_UPDATED,\n AgentTaskStatus.PLANNING_REREQUESTED\n ].includes(response.taskStatus)\n })\n const taskStatus = tuples[index].taskStatus\n\n if (taskStatus !== AgentTaskStatus.PLANNING_COMPLETED) {\n return getNewCodePlanFromTuples(tuples, index)\n }\n\n return getCodePlanFromTupleResponse(completedTuple)\n }\n return null\n}\n","import { useMessages } from '~/hooks/conversation'\n\nexport function useTaskBlock() {\n const messages = useMessages()\n const taskMessage = messages.find(message => message.blocks?.[0]?.type === 'task')\n return taskMessage?.blocks?.[0]\n}\n","import { AgentTaskStatus } from '~/protos/agents'\nimport { useTaskObj } from './useTaskObj'\nimport useAdminConversation from '../super-admin/useAdminConversation'\nimport { verifyUUID } from '~/utils/utils'\n\nexport function useTaskDoc(index?: number, uuid?: string) {\n if (!!uuid && !verifyUUID(uuid)) {\n uuid = undefined // if uuid is not valid, then just return \"\"\n }\n let taskObj = useTaskObj(uuid ?? null)\n const conversation = useAdminConversation({ uuid: uuid ?? null })\n if (!taskObj && conversation && !!uuid) taskObj = conversation.task\n\n let documentGenerated\n let seneraiosGenerated\n\n if (index) {\n documentGenerated = taskObj?.details.orderedStateResponses[index]\n seneraiosGenerated = taskObj?.details.orderedStateResponses[index]\n } else {\n documentGenerated = taskObj?.details.orderedStateResponses.findLast(response => {\n return response.taskStatus === AgentTaskStatus.DOCUMENT_GENERATED\n })\n seneraiosGenerated = taskObj?.details.orderedStateResponses.findLast(response => {\n return response.taskStatus === AgentTaskStatus.MUNIT_SCENARIO_GENERATED\n })\n }\n\n const document = documentGenerated?.response?.[0]?.responseContentStream?.document\n const migrationDoc = documentGenerated?.response?.[0]?.responseContentStream?.migrationDocOutput\n\n if (document?.addFlowCode) {\n return document?.addFlowCode\n }\n if (migrationDoc) {\n return migrationDoc?.docMd ?? ''\n }\n if (documentGenerated) {\n for (const [key, value] of Object.entries(document!)) {\n if (value == null || value == null || value === '' || key === 'mappingSheetCsv') {\n continue\n }\n return value\n }\n }\n if (seneraiosGenerated) {\n return seneraiosGenerated.response?.[0].responseContentStream?.munitScenarios?.mdText!\n }\n return ''\n}\n","import { useConversations } from '../conversation/useConversations'\nimport { useConversationUuid } from '../conversation/useConversationUuid'\nimport { useTaskObj } from './useTaskObj'\n\nexport function useTaskId() {\n const {conversations} = useConversations()\n const uuid = useConversationUuid()\n\n const taskIdFromConversations = conversations.find(\n conversation => conversation.uuid === uuid\n )?.task_id\n const taskIdFromTaskObj = useTaskObj()?.task_id\n\n const taskId = taskIdFromTaskObj || taskIdFromConversations\n return taskId\n}\n","import { useConversations } from '../conversation/useConversations'\nimport { useConversationUuid } from '../conversation/useConversationUuid'\nimport { useTaskObj } from './useTaskObj'\n\nexport function useTaskLastUpdated(): number | null {\n const taskObj = useTaskObj()\n const uuid = useConversationUuid()\n const { conversations } = useConversations()\n\n if (taskObj == null) {\n const conversation = conversations.find(c => c.uuid === uuid)\n // This is task_udpated_at is not the one we want to use\n // Fix it later. Another way to do this is to join the taskObj to\n // conversation object. So when toggling between tasks, we can get the\n // last updated time from the task object.\n return conversation?.task_updated_at || null\n }\n\n const items = taskObj.details.orderedStateResponses\n const resopnse = items[items.length - 1]\n return Number(resopnse!.createdTsSec) * 1000\n}\n","import { createSelector } from '@reduxjs/toolkit'\nimport { useSelector } from 'react-redux'\nimport { RootState } from '~/store'\nimport { type TaskObject } from '~/types/TaskType'\nimport { useConversationUuid } from '../conversation/useConversationUuid'\n\nexport function useTaskObj(uuid: string | null = null) {\n const currentUuid = useConversationUuid(uuid || undefined)\n const uuidToUse = uuid || currentUuid\n\n const selectTaskObj = (uuid: string) => {\n return createSelector(\n [(state: RootState) => state.chat.task_objs],\n (task_objs): TaskObject | null => {\n const taskObj = task_objs[uuid]\n if (taskObj == null) {\n return null\n }\n return taskObj\n }\n )\n }\n\n return useSelector(selectTaskObj(uuidToUse))\n}\n","import { useDisclosure } from '@nextui-org/react'\nimport React, { useEffect } from 'react'\nimport { useSelector } from 'react-redux'\nimport BaseModal from '~/components/modals/base/BaseModal'\nimport store, { RootState } from '~/store'\nimport { setModalParams } from '~/store/modalSlice'\nimport { AppEvents, globalEventEmitter } from '~/utils/shared'\nimport { cm } from '~/utils/utils'\n\nexport enum ModalId {\n TaskStatusDetails = 'task-status-details-modal',\n FreeTrialModal = 'free-trial-modal',\n SignupModal = 'signup-modal'\n}\n\ninterface CommonModalProps {\n id: ModalId\n Component: React.FC\n className?: string\n contentClassName?: string\n}\n\nexport function CommonModal({\n Component,\n id,\n className,\n contentClassName\n}: CommonModalProps) {\n const { isOpen, onOpen, onClose, onOpenChange } = useDisclosure()\n const props = useSelector((state: RootState) => state.modals.modalParams[id])\n\n useEffect(() => {\n const handleOpen = ({ id: modalId, params }: { id: ModalId; params: T }) => {\n if (modalId === id) {\n store.dispatch(setModalParams({ id, params }))\n onOpen()\n }\n }\n const handleClose = ({ id: modalId }: { id: ModalId }) => {\n if (modalId === id) {\n onClose()\n }\n }\n\n globalEventEmitter.on(AppEvents.OpenModal, handleOpen)\n globalEventEmitter.on(AppEvents.CloseModal, handleClose)\n\n return () => {\n globalEventEmitter.off(AppEvents.OpenModal, handleOpen)\n globalEventEmitter.off(AppEvents.CloseModal, handleClose)\n }\n }, [])\n\n return (\n \n \n \n )\n}\n\nexport function useModalController(id: ModalId) {\n return {\n openModal: (params: T) => {\n globalEventEmitter.emit(AppEvents.OpenModal, { id, params })\n },\n closeModal: () => {\n globalEventEmitter.emit(AppEvents.CloseModal, { id })\n }\n }\n}\n","// this file generate by script, don't modify it manually!!!\nexport enum I18nKey {\n WORKSPACE$TITLE = \"WORKSPACE$TITLE\",\n WORKSPACE$FLOW_EDITOR_TAB_LABEL = \"WORKSPACE$FLOW_EDITOR_TAB_LABEL\",\n WORKSPACE$PLANNER_TAB_LABEL = \"WORKSPACE$PLANNER_TAB_LABEL\",\n WORKSPACE$MARKDOWN_EDITOR_TAB_LABEL = \"WORKSPACE$MARKDOWN_EDITOR_TAB_LABEL\",\n WORKSPACE$CODE_EDITOR_TAB_LABEL = \"WORKSPACE$CODE_EDITOR_TAB_LABEL\",\n WORKSPACE$BROWSER_TAB_LABEL = \"WORKSPACE$BROWSER_TAB_LABEL\",\n WORDSPACE$HELP_TAB_LABEL = \"WORDSPACE$HELP_TAB_LABEL\",\n WORKSPACE$PLAN_TAB_LABEL = \"WORKSPACE$PLAN_TAB_LABEL\",\n PLANNER$EMPTY_MESSAGE = \"PLANNER$EMPTY_MESSAGE\",\n WORKSPACE$NEW_SESSION = \"WORKSPACE$NEW_SESSION\",\n WORKSPACE$TODAY = \"WORKSPACE$TODAY\",\n WORKSPACE$YESTERDAY = \"WORKSPACE$YESTERDAY\",\n WORKSPACE$PREVIOUS_SEVEN_DAYS = \"WORKSPACE$PREVIOUS_SEVEN_DAYS\",\n WORKSPACE$PREVIOUS_THIRTY_DAYS = \"WORKSPACE$PREVIOUS_THIRTY_DAYS\",\n WORKSPACE$PREVIOUS_PREVIOUS_ONE_YEAR = \"WORKSPACE$PREVIOUS_PREVIOUS_ONE_YEAR\",\n WORKSPACE$OLDER_THAN_ONE_YEAR = \"WORKSPACE$OLDER_THAN_ONE_YEAR\",\n USER_PROFILE$HELP_AND_FEEDBACK = \"USER_PROFILE$HELP_AND_FEEDBACK\",\n USER_PROFILE$SETTING = \"USER_PROFILE$SETTING\",\n USER_PROFILE$SIGN_OUT = \"USER_PROFILE$SIGN_OUT\",\n SETTING$GENERAL = \"SETTING$GENERAL\",\n SETTING$USER = \"SETTING$USER\",\n SETTING$ORGANIZATION = \"SETTING$ORGANIZATION\",\n SETTING$INTERATIONS = \"SETTING$INTERATIONS\",\n SETTING$INDEXERS = \"SETTING$INDEXERS\",\n SETTING$THEME = \"SETTING$THEME\",\n SETTING$LANGUAGE = \"SETTING$LANGUAGE\",\n SETTING$NAME = \"SETTING$NAME\",\n SETTING$USER_NAME = \"SETTING$USER_NAME\",\n SETTING$EMAIL = \"SETTING$EMAIL\",\n SETTING$PASSWORD = \"SETTING$PASSWORD\",\n SETTING$SET_PASSWORD = \"SETTING$SET_PASSWORD\",\n SETTING$SET_SSO = \"SETTING$SET_SSO\",\n SETTING_BUTTON$CHANGE_EMAIL = \"SETTING_BUTTON$CHANGE_EMAIL\",\n SETTING_BUTTON$CHANGE_PASSWORD = \"SETTING_BUTTON$CHANGE_PASSWORD\",\n SETTING_BUTTON$SET_UP = \"SETTING_BUTTON$SET_UP\",\n SETTING_BUTTON$DELETE_ACCOUNT = \"SETTING_BUTTON$DELETE_ACCOUNT\",\n CONFIGURATION$CURIE_WORKSPACE_DIRECTORY_INPUT_LABEL = \"CONFIGURATION$CURIE_WORKSPACE_DIRECTORY_INPUT_LABEL\",\n CONFIGURATION$CURIE_WORKSPACE_DIRECTORY_INPUT_PLACEHOLDER = \"CONFIGURATION$CURIE_WORKSPACE_DIRECTORY_INPUT_PLACEHOLDER\",\n SETTINGS$MODAL_TITLE = \"SETTINGS$MODAL_TITLE\",\n CONFIGURATION$MODAL_SUB_TITLE = \"CONFIGURATION$MODAL_SUB_TITLE\",\n CONFIGURATION$MODEL_SELECT_LABEL = \"CONFIGURATION$MODEL_SELECT_LABEL\",\n CONFIGURATION$MODEL_SELECT_PLACEHOLDER = \"CONFIGURATION$MODEL_SELECT_PLACEHOLDER\",\n CONFIGURATION$AGENT_SELECT_LABEL = \"CONFIGURATION$AGENT_SELECT_LABEL\",\n CONFIGURATION$AGENT_SELECT_PLACEHOLDER = \"CONFIGURATION$AGENT_SELECT_PLACEHOLDER\",\n CONFIGURATION$LANGUAGE_SELECT_LABEL = \"CONFIGURATION$LANGUAGE_SELECT_LABEL\",\n CONFIGURATION$LANGUAGE_SELECT_PLACEHOLDER = \"CONFIGURATION$LANGUAGE_SELECT_PLACEHOLDER\",\n CONFIGURATION$MODAL_CLOSE_BUTTON_LABEL = \"CONFIGURATION$MODAL_CLOSE_BUTTON_LABEL\",\n CONFIGURATION$MODAL_SAVE_BUTTON_LABEL = \"CONFIGURATION$MODAL_SAVE_BUTTON_LABEL\",\n CONFIGURATION$MODAL_RESET_BUTTON_LABEL = \"CONFIGURATION$MODAL_RESET_BUTTON_LABEL\",\n CONFIGURATION$SETTINGS_NEED_UPDATE_MESSAGE = \"CONFIGURATION$SETTINGS_NEED_UPDATE_MESSAGE\",\n CONFIGURATION$AGENT_LOADING = \"CONFIGURATION$AGENT_LOADING\",\n CONFIGURATION$AGENT_RUNNING = \"CONFIGURATION$AGENT_RUNNING\",\n LOAD_SESSION$MODAL_TITLE = \"LOAD_SESSION$MODAL_TITLE\",\n LOAD_SESSION$MODAL_CONTENT = \"LOAD_SESSION$MODAL_CONTENT\",\n LOAD_SESSION$RESUME_SESSION_MODAL_ACTION_LABEL = \"LOAD_SESSION$RESUME_SESSION_MODAL_ACTION_LABEL\",\n LOAD_SESSION$START_NEW_SESSION_MODAL_ACTION_LABEL = \"LOAD_SESSION$START_NEW_SESSION_MODAL_ACTION_LABEL\",\n CHAT_INTERFACE$INITIALZING_AGENT_LOADING_MESSAGE = \"CHAT_INTERFACE$INITIALZING_AGENT_LOADING_MESSAGE\",\n CHAT_INTERFACE$INPUT_PLACEHOLDER = \"CHAT_INTERFACE$INPUT_PLACEHOLDER\",\n CHAT_INTERFACE$INPUT_SEND_MESSAGE_BUTTON_CONTENT = \"CHAT_INTERFACE$INPUT_SEND_MESSAGE_BUTTON_CONTENT\",\n CHAT_INTERFACE$ASSISTANT = \"CHAT_INTERFACE$ASSISTANT\",\n SETTINGS$MODEL_TOOLTIP = \"SETTINGS$MODEL_TOOLTIP\",\n SETTINGS$AGENT_TOOLTIP = \"SETTINGS$AGENT_TOOLTIP\",\n SETTINGS$LANGUAGE_TOOLTIP = \"SETTINGS$LANGUAGE_TOOLTIP\",\n SETTINGS$DISABLED_RUNNING = \"SETTINGS$DISABLED_RUNNING\",\n CODE_EDITOR$LOADING_MESSAGE = \"CODE_EDITOR$LOADING_MESSAGE\",\n ORGANIZATION$INVITE_MEMBER = \"ORGANIZATION$INVITE_MEMBER\",\n ORGANIZATION_BUTTON$COPY_LINK = \"ORGANIZATION_BUTTON$COPY_LINK\",\n ORGANIZATION$MEMBERS = \"ORGANIZATION$MEMBERS\",\n ORGANIZATION_TABLE$NAME = \"ORGANIZATION_TABLE$NAME\",\n ORGANIZATION_TABLE$ROLE = \"ORGANIZATION_TABLE$ROLE\",\n ORGANIZATION_TABLE$EMAIL = \"ORGANIZATION_TABLE$EMAIL\",\n INTERGRATION$GITHUB = \"INTERGRATION$GITHUB\",\n INTERGRATION$JIRA = \"INTERGRATION$JIRA\",\n INTERGRATION$SLACK = \"INTERGRATION$SLACK\",\n INTERGRATION_BUTTON$CONNECT = \"INTERGRATION_BUTTON$CONNECT\",\n INTERGRATION_BUTTON$CONNECTED = \"INTERGRATION_BUTTON$CONNECTED\",\n INTERGRATION_BUTTON$CONFIGURE = \"INTERGRATION_BUTTON$CONFIGURE\",\n USERFORM_CHANGE_PWD_MODAL$MODAL_TITLE = \"USERFORM_CHANGE_PWD_MODAL$MODAL_TITLE\",\n USERFORM_CHANGE_PWD_MODAL$INPUT_NEW_PASSWORD = \"USERFORM_CHANGE_PWD_MODAL$INPUT_NEW_PASSWORD\",\n USERFORM_CHANGE_PWD_MODAL$INPUT_NEW_PASSWORD_PLACEHOLDER = \"USERFORM_CHANGE_PWD_MODAL$INPUT_NEW_PASSWORD_PLACEHOLDER\",\n USERFORM_CHANGE_PWD_MODAL$CONFIRM_PASSWORD = \"USERFORM_CHANGE_PWD_MODAL$CONFIRM_PASSWORD\",\n USERFORM_CHANGE_PWD_MODAL$CONFIRM_PASSWORD_PLACEHOLDER = \"USERFORM_CHANGE_PWD_MODAL$CONFIRM_PASSWORD_PLACEHOLDER\",\n USERFORM_CHANGE_PWD_MODAL$ERROR_MESSAGE = \"USERFORM_CHANGE_PWD_MODAL$ERROR_MESSAGE\",\n USERFORM_CHANGE_PWD_MODAL$CONFIRM_BUTTON = \"USERFORM_CHANGE_PWD_MODAL$CONFIRM_BUTTON\",\n USERFORM_DELETE_ACCOUNT_MODEL$MODAL_TITLE = \"USERFORM_DELETE_ACCOUNT_MODEL$MODAL_TITLE\",\n USERFORM_DELETE_ACCOUNT_MODEL$MODAL_CONTENT = \"USERFORM_DELETE_ACCOUNT_MODEL$MODAL_CONTENT\",\n USERFORM_DELETE_ACCOUNT_MODEL$DELETE_BUTTON = \"USERFORM_DELETE_ACCOUNT_MODEL$DELETE_BUTTON\",\n}\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit'\n\nexport interface DiffComment {\n comment: string\n filePath: string\n startLineNumber: number\n endLineNumber: number\n fileContent: string\n}\n\nexport interface DiffReview {\n generalDiffComment: string\n diffComments: DiffComment[]\n}\n\ntype SliceState = {\n reviews: Record\n}\n\nconst initialState: SliceState = {\n reviews: {}\n}\n\nexport const editorSlice = createSlice({\n name: 'chat',\n initialState,\n reducers: {\n setGeneralDiffComment(\n state,\n action: PayloadAction<{ uuid: string; generalDiffComment: string }>\n ) {\n const { uuid, generalDiffComment } = action.payload\n const review = state.reviews[uuid] || {}\n review.generalDiffComment = generalDiffComment\n state.reviews[uuid] = review\n },\n upsertDiffComment(state, action: PayloadAction<{ uuid: string; comment: DiffComment }>) {\n const { uuid, comment } = action.payload\n const review = state.reviews[uuid] || {}\n const diffComments = review.diffComments || []\n const existingComment = diffComments.find(\n c => c.filePath === comment.filePath && c.startLineNumber === comment.startLineNumber\n )\n if (existingComment) {\n existingComment.comment = comment.comment\n } else {\n diffComments.push(comment)\n }\n review.diffComments = diffComments\n state.reviews[uuid] = review\n }\n }\n})\n\nexport const { setGeneralDiffComment, upsertDiffComment } = editorSlice.actions\n\nexport default editorSlice.reducer\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit';\n\nexport const modalsSlice = createSlice({\n name: 'modals',\n initialState: {\n modalParams: {} as Record>\n },\n reducers: {\n setModalParams(state, action: PayloadAction<{ id: string; params: Record }>) {\n const { id, params } = action.payload\n const modal = state.modalParams[id]\n if (modal) {\n state.modalParams[id] = { ...modal, ...params }\n } else {\n state.modalParams[id] = params\n }\n }\n }\n})\n\nexport const { setModalParams } = modalsSlice.actions\nexport default modalsSlice.reducer\n","enum TabOption {\n HELP = 'help',\n FLOW_EDITOR = 'flow-editor',\n CODE_EDITOR = 'diff-editor',\n MARKDOWN_EDITOR = 'markdown-editor',\n PLAN = 'plan',\n InlineChat = 'inline-chat'\n}\n\ntype TabType =\n | TabOption.CODE_EDITOR\n | TabOption.FLOW_EDITOR\n | TabOption.HELP\n | TabOption.PLAN\n | TabOption.MARKDOWN_EDITOR\n | TabOption.InlineChat\n\nconst AllTabs = [\n TabOption.FLOW_EDITOR,\n TabOption.CODE_EDITOR,\n TabOption.HELP,\n TabOption.PLAN,\n TabOption.MARKDOWN_EDITOR,\n TabOption.InlineChat\n]\n\nexport { AllTabs, TabOption, type TabType }\n","export const serverSideProps = window.__INITIAL_DATA__ || {}\n\ninterface ServerConfig {\n email_verification_enabled: boolean\n mulesoft_to_nodejs_enabled: boolean\n mulesoft_to_camel_enabled: boolean\n sso_enabled: boolean\n sso_type: string\n agent_type: number\n is_root_admin: boolean\n}\n\nexport const serverConfig = (key: keyof ServerConfig) => {\n const { configurations = {} } = serverSideProps\n return configurations?.[key]\n}\n","import { cn } from '@nextui-org/react'\nimport React from 'react'\n\ninterface CurieInputProps {\n id?: string\n placeholder?: string\n value: string\n onChange: (e: React.ChangeEvent) => void\n defaultValue?: string\n className?: string\n autoComplete?: string\n type?: 'email' | 'password' | 'text'\n autoFocus?: boolean\n disabled?: boolean\n onBlur?: (e: React.FocusEvent) => void\n}\n\nexport function Input({\n id,\n placeholder,\n value,\n onChange,\n defaultValue,\n className = '',\n type = 'text',\n autoComplete = 'off',\n autoFocus = false,\n disabled = false,\n onBlur\n}: CurieInputProps) {\n return (\n \n )\n}\n","import React, { forwardRef } from 'react'\n\ninterface ButtonProps extends React.ButtonHTMLAttributes {\n children: React.ReactNode\n className?: string\n isDisabled?: boolean\n}\n\nexport const PrimaryButton = forwardRef(\n ({ children, isDisabled = false, className = '', type = 'button', onClick, ...props }, ref) => {\n return (\n \n \n \n {children}\n \n \n \n )\n }\n)\n"],"names":["initialDiffs","readOnly","uuid","useConversationUuid","diffs","setDiffs","useState","activeDiff","setActiveDiff","isS3Task","useIsS3Task","taskBlock","useTaskBlock","isInternalUploadedIndex","useIsInternalUploadedIndex","isLocalSyncIndex","useIsLocalSyncIndex","command","useConversationMetadata","isMulesoftToCamel","CommandType","isReadOnly","onAcceptDiff","Array","applyDiff","BetterToast","globalEventEmitter","AppEvents","TabOption","cn","TaskBlock","FileList","DiffEditor","fileContent","diff","SimpleTextarea","forwardRef","className","onChange","enter2Submit","minRows","maxRows","placeholder","autoFocus","value","defaultValue","userInputClassName","onBlur","forwardedRef","inputClassName","innerRef","useSimpleTextareaClassName","isComposing","setIsComposing","refCallback","useCallback","textareaElement","CurieTextarea","e","event","cm","UserPopover","userName","userId","isOpen","setIsOpen","user","setUser","users","useOrgUsers","handleMouseEnter","handleMouseLeave","useEffect","userInfo","Popover","open","PopoverTrigger","PopoverContent","generateAvatar","dayjs","duration","getStatusText","status","agentTaskStatusToJSON","AgentTaskStatus","toCamelCase","fields","verifyUUID","progress","useTaskProgress","branch","taskId","useTaskId","TaskBlockHeader","TaskProgressBar","agentTaskStatusFromJSON","TaskDuration","createdTime","taskLastUpdatedAt","useTaskLastUpdated","latestTime","setLatestTime","isTerminatedStatus","useTerminatedStatus","timer","setInterval","Date","clearInterval","hours","minutes","seconds","Math","durationInStr","MdAccessTime","percentage","taskStatus","statusText","TaskStatuses","statusColor","styles","CodePlanViewer","codePlan","isSubmitPlanDisabled","setIsSubmitPlanDisabled","t","useTranslation","selectedFileNames","setSelectedFileNames","useTaskStatus","svgFlows","onSubmitPlan","editedPlan","JSON","approvePlan","renderPlan","changeTypeColors","DiffType","allOptions","options","option","changeTypeClass","SVGPlan","Checkbox","evnet","prev","name","diffTypeToJSON","CurieMarkdown","Button","VscListOrdered","I18nKey","readonly","useCodePlan","FaListOl","hideSubmitButton","isApproving","setIsApproving","isRegenerating","setIsRegenerating","onRegeneratePlan","regeneratePlan","onApprovePlan","imageBase64","svg2base64","isDisabled","codelensDisposable","initializeMonaco","memo","onContentChange","isCodelensRegistered","useRef","cursorLocatorRef","commentModalPayloadRef","diffEditorRef","diffEditorElementRef","monacoOptions","getMonacoOptions","isReviewModalOpen","onReviewModalOpen","onReviewModalClose","onReviewModalOpenChange","useDisclosure","handleResize","comments","upsertComment","commentsRef","useReviewDiffCommentsWithRef","diffEditorElement","containerElement","original","monaco","modified","diffEditor","language","resizeObserver","ResizeObserver","window","modifiedModel","addCommentId","ctx","selection","modifiedEditor","startPosition","endPosition","range","Infinity","endPositionPlusOne","position","top","left","container","rootRect","containerRect","baseTop","baseLeft","setCommentText","editCommentId","comment","getLineRangeText","startLineNumber","endLineNumber","truncateText","text","limit","highlightCommentLines","decorations","updateCodeLenses","selections","lenses","rangeText","truncatedComment","model","_","codeLens","newFileContent","commentText","SecondaryButton","PrimaryButton","Object","VscCode","prevProps","nextProps","onSelectDiff","fileListsOnly","disabled","setIsDisabled","React","getLabel","diffType","getFilePath","renderLabel","label","handleRequestChanges","requestChanges","handleDownloadDiffPatch","patch","createTwoFilesPatch","blob","Blob","url","a","document","error","console","handleDownloadZip","zip","JSZip","folderA","folderB","addFileToZip","filePath","targetFolder","pathSegments","fileName","currentFolder","segment","content","handleAcceptDiff","setComment","useGeneralReviewComment","mode","shouldDisableCodeReview","commandTypeToJSON","index","PopoverNavDownIcon","DownloadPopover","ReviewHistory","title","reviewItems","useReviewHistory","ControlledExpandedNode","item","children","inlineComments","groupBy","conversationUuid","review","useSelector","state","store","setGeneralDiffComment","upsertDiffComment","taskObj","useTaskObj","tuples","request","tuple","Number","highlighter","createHighlighter","shikiToMonaco","MONACO_COMMON_OPTIONS","getCodePlanFromTupleRequest","getCodePlanFromTupleResponse","getDiffFromTupleResponse","getDocumentFromTupleResponse","document1","key","md","csvToMarkdown","getCommentFromTupleRequest","getDocumentWithCommentFromTupleRequest","generatedTuple","tupleIndex","getNewCodePlanFromTuples","completedTuple","originalCodePlan","editedCodePlan","newCodePlan","TaskStatusDetailModal","description","closeModal","useModalController","ModalId","conversation","useAdminConversation","isDiffTaskStatus","TaskStatusDetailType","renderUploadedImages","task","images","image","imageUrl","CurieMarkdownImg","renderUploadedSpreadsheets","spreadsheets","handleDownload","spreadsheet","Buffer","file","File","PiMicrosoftExcelLogoLight","IoMdDownload","renderDetail","diffSha256","sha256","CodeEditor","response","markdown","highlighted","highlightLines","startLine","endLine","lines","HeaderContent","subtitle","onOpenChange","isDismissable","size","scrollBehavior","backdrop","parentRef","headerBorder","contentClassName","bodyClassName","wrapperClassName","portalContainer","Modal","ModalContent","ModalHeader","VscClose","ModalBody","node","TreeView","flattenTree","element","isBranch","isExpanded","getNodeProps","level","handleExpand","color","ArrowIcon","classes","VscChevronDown","VscChevronRight","DEFAULT_QA_GUIDELINES","uuidToUse","isCampaignUuid","useCampaignAgentType","conversations","useConversations","c","metadata","undefined","commandTypeFromJSON","pathname","useLocation","currentUuid","data","fetchNextPage","hasNextPage","isFetching","useInfiniteQuery","QueryKeys","pageParam","getConversationsPaginated","lastPage","page","useMessages","effectiveUuid","useQuery","getOrgUsers","queryKey","getConversationByUuid","taskMessage","messages","message","useTaskDoc","documentGenerated","seneraiosGenerated","migrationDoc","taskIdFromConversations","taskIdFromTaskObj","items","resopnse","createSelector","task_objs","CommonModal","Component","id","onOpen","onClose","props","handleOpen","modalId","params","setModalParams","handleClose","BaseModal","editorSlice","createSlice","initialState","action","generalDiffComment","diffComments","existingComment","modalsSlice","modal","serverSideProps","serverConfig","configurations","Input","type","autoComplete","onClick","ref"],"mappings":"iIACA,MAAe,CAAC,SAAW,iBAAiB,C,uXC2E5C,MApDA,SAAoB,CAAEA,aAAAA,CAAY,CAAEC,SAAAA,EAAW,EAAK,CAAmB,EACrE,IAAMC,EAAOC,AAAAA,GAAAA,EAAAA,EAAAA,AAAAA,IACP,CAACC,EAAOC,EAAS,CAAGC,AAAAA,GAAAA,EAAAA,QAAAA,AAAAA,EAAwBN,GAAgB,MAC5D,CAACO,EAAYC,EAAc,CAAGF,AAAAA,GAAAA,EAAAA,QAAAA,AAAAA,EAAsBF,GAAO,CAAC,EAAE,EAAI,MAClEK,EAAWC,AAAAA,GAAAA,EAAAA,CAAAA,AAAAA,IACXC,EAAYC,AAAAA,GAAAA,EAAAA,CAAAA,AAAAA,IACZC,EAA0BC,AAAAA,GAAAA,EAAAA,EAAAA,AAAAA,IAC1BC,EAAmBC,AAAAA,GAAAA,EAAAA,EAAAA,AAAAA,IACnB,CAAEC,QAAAA,CAAO,CAAE,CAAGC,AAAAA,GAAAA,EAAAA,EAAAA,AAAAA,IACdC,EAAoBF,IAAYG,EAAAA,EAAAA,CAAAA,2BAAuC,CACvEC,EACJZ,GAAYR,GAAYY,GAA2BE,GAAoBI,EASnEG,EAAe,UACfC,MAAM,OAAO,CAACnB,KAChB,MAAMoB,AAAAA,GAAAA,EAAAA,EAAAA,AAAAA,EAAU,CAAEtB,KAAAA,EAAME,MAAAA,CAAM,GAC9BqB,EAAAA,CAAAA,CAAAA,OAAmB,CAAC,gB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