{"version":3,"file":"13766.c66680e7.js","sources":["webpack://app/./src/components/chat/ChatInput.tsx","webpack://app/./src/constants/commands.tsx","webpack://app/./src/hooks/organization/useIndexes.tsx","webpack://app/./src/services/conversationService.ts","webpack://app/./src/services/organizationService.ts","webpack://app/./src/utils/utils.ts"],"sourcesContent":["import { FloatingButton } from '@curie/react'\nimport { Checkbox, extendVariants, Textarea } from '@nextui-org/react'\nimport { LuLoader } from '@react-icons/all-files/lu/LuLoader'\nimport { VscAdd } from '@react-icons/all-files/vsc/VscAdd'\nimport { VscArrowUp } from '@react-icons/all-files/vsc/VscArrowUp'\nimport { VscDebugRestart } from '@react-icons/all-files/vsc/VscDebugRestart'\nimport type { KeyboardEvent } from 'react'\nimport { useEffect, useRef, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport {\n AgentCommand,\n AgentCommands,\n CommandType,\n FixedPromptCommands,\n FormCommands,\n isChatCommand,\n UsedCommandType\n} from '~/constants/commands'\nimport { isAwaitingUserInput, isTerminated } from '~/constants/task-status'\nimport {\n useConversationMetadata,\n useConversationUuid,\n useMessages,\n useNewConversation,\n useSimpleTextareaClassName,\n useStopTask,\n useTaskObj,\n useTaskStatus,\n useUser\n} from '~/hooks'\nimport { I18nKey } from '~/i18n/declaration'\nimport { AgentRequest, commandTypeToJSON, DBAgentTaskRequestResponse } from '~/protos/agents'\nimport { updateConversationTitle } from '~/services/conversationService'\nimport store from '~/store'\nimport { setConversationTitle } from '~/store/conversationSlice'\nimport { createTask } from '~/utils/eventUtils'\nimport { cm } from '~/utils/utils'\n\nexport const CurieTextarea = extendVariants(Textarea, {\n variants: {\n color: {\n stone: {\n inputWrapper: [\n 'data-[hover=true]:bg-white dark:data-[hover=true]:bg-medium7',\n 'group-data-[focus=true]:ring-gray-300 dark:group-data-[focus=true]:ring-gray-500',\n 'group-data-[focus-visible=true]:ring-1',\n 'group-data-[focus-visible=true]:ring-offset-0',\n 'group-data-[focus=true]:bg-white dark:group-data-[focus=true]:bg-medium7',\n 'bg-white dark:bg-medium7',\n 'rounded-xl',\n 'ring-1 ring-inset ring-gray-300 dark:ring-gray-700 shadow-sm',\n 'p-[1px]',\n 'overflow-hidden'\n ],\n input: 'py-[10px] pr-16 pl-2 text-black dark:text-white ml-1'\n }\n }\n },\n defaultVariants: {\n color: 'stone',\n textSize: 'base',\n removeLabel: true\n }\n})\n\ninterface ChatInputProps {\n disabled?: boolean\n onSendMessage: (message: string) => void\n onTaskSubmitModalOpen: (isOpen: boolean) => void\n onChange?: (ar: AgentRequest) => void\n setTaskSubmitProps: (props: { command?: UsedCommandType }) => void\n onTaskFormOpen: () => void\n}\n\nfunction ChatInput({\n disabled = false,\n onSendMessage,\n onTaskSubmitModalOpen,\n setTaskSubmitProps,\n onChange,\n onTaskFormOpen\n}: ChatInputProps) {\n const { t } = useTranslation()\n const uuid = useConversationUuid()\n const getNewConversation = useNewConversation()\n const stopTask = useStopTask()\n const user = useUser()\n const [isComposing, setIsComposing] = useState(false)\n const [isDuplicating, setIsDuplicating] = useState(false)\n const [isRegenerating, setIsRegenerating] = useState(false)\n const taskObj = useTaskObj()\n const [isStopping, setIsStopping] = useState(false)\n const [isWebSearchEnabled, setIsWebSearchEnabled] = useState(true)\n const allMessages = useMessages()\n const { with_example_prefilled } = useConversationMetadata()\n const initialMessage =\n with_example_prefilled && allMessages.length === 0 ? 'Give me all apis in the repo' : ''\n const [message, setMessage] = useState(initialMessage)\n\n const { mode } = useConversationMetadata()\n // const isCodeEnhancer = mode === commandTypeToJSON(CommandType.GENERATE_SIMPLE_CODE_PR)\n const isCodeEnhancer = true\n const taskStatus = useTaskStatus()\n const input = useRef(null)\n const allowSend = !disabled && !isComposing && message.trim()\n\n useEffect(() => {\n input?.current?.focus()\n setIsWebSearchEnabled(true)\n onChange?.(AgentRequest.fromPartial({ enableWebSearch: true }))\n }, [uuid])\n\n const { command } = useConversationMetadata()\n\n const openTaskSubmitModal = async (command: AgentCommand) => {\n setTaskSubmitProps({ command: command.id })\n onTaskSubmitModalOpen(true)\n onTaskFormOpen()\n }\n\n const createNewTaskWithSameCommand = async () => {\n if (isDuplicating || isRegenerating) return\n setIsDuplicating(true)\n const conversation = await getNewConversation({ conversation_uuid: uuid })\n if (conversation != null) {\n if (command && FormCommands.includes(command)) {\n await openTaskSubmitModal(AgentCommands[command])\n }\n if (command && FixedPromptCommands.includes(command)) {\n switch (command) {\n case CommandType.GENERATE_FULL_REPO_TECH_MANIFEST_DOCUMENTATION: {\n const request = AgentRequest.fromPartial({\n command: { commandString: 'generate the documentation of the entire repository' }\n })\n createTask({\n uuid: conversation.uuid,\n request\n })\n break\n }\n case CommandType.GENERATE_MULTI_REPO_FLOW_DIAGRAM: {\n const request = AgentRequest.fromPartial({\n command: {\n commandString: 'give me the diagram showing dependencies across all respositories'\n }\n })\n createTask({\n uuid: conversation.uuid,\n request\n })\n break\n }\n }\n }\n }\n setIsDuplicating(false)\n }\n\n const rengenerateTask = async () => {\n if (isDuplicating || isRegenerating) return\n setIsRegenerating(true)\n const { originalRequest } = taskObj?.details as DBAgentTaskRequestResponse\n if (originalRequest) {\n const conversation = await getNewConversation({ conversation_uuid: uuid, initialized: true })\n if (conversation != null) {\n const request = AgentRequest.fromPartial({\n ...originalRequest,\n uuid: conversation.uuid,\n userId: user.user_id,\n userName: user.name\n })\n createTask({\n uuid: conversation.uuid,\n request\n })\n setIsRegenerating(false)\n }\n }\n }\n\n const onStopTask = async () => {\n if (isStopping) return\n setIsStopping(true)\n await stopTask({ uuid })\n setIsStopping(false)\n }\n\n const handleSendChatMessage = async () => {\n if (allowSend) {\n setMessage('')\n onSendMessage(message)\n if (allMessages.length === 0) {\n const title =\n command && AgentCommands[command] ? `${AgentCommands[command].label}` : 'Unknown Task'\n updateConversationTitle({ uuid, title })\n store.dispatch(setConversationTitle({ title, uuid }))\n }\n }\n }\n\n const onKeyPress = (event: KeyboardEvent) => {\n if (event.key === 'Enter' && !event.shiftKey && !isComposing) {\n event.preventDefault() // prevent a new line\n handleSendChatMessage()\n }\n }\n const { ref: chatInputRef, className: chatInputClassName } = useSimpleTextareaClassName({\n initialHeight: 40\n })\n\n return (\n \n \n setMessage(e.target.value)}\n onKeyDown={onKeyPress}\n onCompositionStart={() => setIsComposing(true)}\n onCompositionEnd={() => setIsComposing(false)}\n placeholder={\n isChatCommand(command)\n ? 'Message Curie...'\n : t(I18nKey.CHAT_INTERFACE$INPUT_PLACEHOLDER)\n }\n className={cm('select-none px-3 outline-0', chatInputClassName)}\n ref={ref => {\n input.current = ref\n chatInputRef.current = ref\n }}\n maxRows={10}\n minRows={1}\n />\n\n \n \n \n \n \n {\n setIsWebSearchEnabled(event.target.checked)\n const ar = AgentRequest.fromPartial({ enableWebSearch: event.target.checked })\n onChange?.(ar)\n }}\n classNames={{\n base: 'before:border-none',\n wrapper: 'before:rounded-xl before:border-1 rounded-xl text-white after:rounded-xl'\n }}\n />\n
Web Search
\n \n {isTerminated(taskStatus) && command ? (\n
\n {FixedPromptCommands.includes(command) ? null : (\n \n {isDuplicating ? (\n \n ) : (\n \n )}\n New {AgentCommands[command].label.replace(/task/i, '')} task\n \n )}\n {isCodeEnhancer ? null : (\n \n {isRegenerating ? (\n \n ) : (\n \n )}\n Regenerate\n \n )}\n
\n ) : null}\n \n )\n}\n\nexport default ChatInput\n","import { RiQuestionAnswerLine } from '@react-icons/all-files/ri/RiQuestionAnswerLine'\nimport { ReactNode } from 'react'\nimport { ApacheCamelIcon } from '~/components/icons'\nimport { TaskParams } from '~/components/modals/task-forms/BaseTaskForm'\nimport CodeReview from '~/docs/CodeReview.md'\nimport GenerateAddFlowCodePR from '~/docs/GenerateAddFlowCodePR.md'\nimport GenerateDataweave from '~/docs/GenerateDataweave.md'\nimport DataweaveToDataCreation from '~/docs/GenerateDataweaveToDataCreation.md'\nimport GenerateDocumentation from '~/docs/GenerateDocumentation.md'\nimport GenerateFullRepoTechManifestDocumentation from '~/docs/GenerateFullRepoTechManifestDocumentation.md'\nimport GenerateImage from '~/docs/GenerateImage.md'\nimport GenerateMappingTable from '~/docs/GenerateMappingTable.md'\nimport GenerateMultiRepoFlowDiagramFlows from '~/docs/GenerateMultiRepoFlowDiagramFlows.md'\nimport GenerateMUnitTestsForFlow from '~/docs/GenerateMUnitTestsForFlow.md'\nimport MdInputOutputToDWL from '~/docs/InputOutputToDWL.md'\nimport MulesoftToCamel from '~/docs/MulesoftToCamel.md'\nimport MulesoftToNodeJS from '~/docs/MulesoftToNodeJS.md'\nimport MultiRepoQuestionAnswering from '~/docs/MultiRepoQuestionAnswering.md'\nimport MultiRepoQuestionAnsweringDebug from '~/docs/MultiRepoQuestionAnsweringDebug.md'\nimport QuestionAnswering from '~/docs/QuestionAnswering.md'\nimport MdSimpleCodingTask from '~/docs/SimpleCodingTask.md'\nimport { AgentTaskStatus, CommandType } from '~/protos/agents'\nimport {\n ChatIcon,\n CodeIcon,\n DiagramIcon,\n DocumentIcon,\n MigrationIcon,\n NodeJsIcon,\n RepositoryIcon,\n TableIcon,\n TestIcon\n} from './icon'\n\nexport type UsedCommandType = Exclude<\n CommandType,\n CommandType.NONE | CommandType.UNRECOGNIZED | CommandType.FIX_PR\n>\n\nexport enum RequiredField {\n MULTI_REPO = 'multiRepo',\n REPO = 'repo',\n BRANCH = 'branch',\n DESCRIPTION = 'description',\n FLOW = 'flow',\n API = 'api',\n MAPPING_TABLE = 'mappingTable',\n DATAWEAVE = 'dataweave',\n INPUT_OUTPUT_EXAMPLES = 'inputOutputExamples'\n}\n\nexport interface AgentCommand {\n id: UsedCommandType\n label: string\n desc: string\n icon: ReactNode\n doc: string\n requiredFields: RequiredField[]\n steps: AgentTaskStatus[]\n codeContextGroup?: CodeContextGroup\n codeContextOption?: CodeContextOption[]\n}\nexport type TypeAgentCommands = {\n [index in UsedCommandType]: AgentCommand\n}\nexport enum CodeContextGroup {\n DATAWEAVE = 'DATAWEAVE',\n INTEGRATION = 'INTEGRATION',\n SAMPLE_DATA = 'SAMPLE_DATA',\n STANDALONE = 'STANDALONE_'\n}\n\nexport enum CodeContextOption {\n NO_REPOSITORY = 'NO_REPOSITORY',\n WITH_REPOSITORY = 'WITH_REPOSITORY',\n UPLOAD_FROM_COMPUTER = 'UPLOAD_FROM_COMPUTER',\n WITH_MAPPING_TABLE = 'WITH_MAPPING_TABLE'\n}\n\nexport const getCommandCodeContextGroup = (\n command?: CommandType\n): CodeContextGroup | string | undefined => {\n if (!command) return undefined\n const agentCommand = AgentCommands[command as UsedCommandType]\n\n if (agentCommand?.codeContextGroup) {\n return agentCommand.codeContextGroup\n }\n\n return `${CodeContextGroup.STANDALONE}${agentCommand.label.toUpperCase().replace(/\\s+/g, '_')}`\n}\n\nconst buildAgentCommands = () => {\n const ICON_SIZE = 24\n const agentCommands: { [index in UsedCommandType]: Omit } = {\n [CommandType.AUTODESK_MULE_TO_NODE_JS_MIGRATION]: {\n label: 'MuleSoft to Node.js',\n desc: 'Migrate MuleSoft Flow/API Endpoint to NodeJS',\n doc: MulesoftToNodeJS,\n icon: ,\n requiredFields: [RequiredField.REPO],\n steps: [AgentTaskStatus.SUBMITTED, AgentTaskStatus.IN_PROGRESS, AgentTaskStatus.COMPLETED]\n },\n [CommandType.MULESOFT_TO_CAMEL_MIGRATION]: {\n label: 'MuleSoft to Camel',\n desc: 'Migrate MuleSoft Flow/API Endpoint to Camel',\n doc: MulesoftToCamel,\n icon: ,\n requiredFields: [RequiredField.REPO, RequiredField.BRANCH, RequiredField.DESCRIPTION],\n steps: [\n AgentTaskStatus.SUBMITTED,\n AgentTaskStatus.IN_PROGRESS,\n AgentTaskStatus.PLANNING_COMPLETED,\n AgentTaskStatus.PLANNING_UPDATED,\n AgentTaskStatus.DIFF_GENERATED,\n AgentTaskStatus.DIFF_COMMENT_ADDED,\n AgentTaskStatus.HUMAN_DIFF_UPDATED\n ]\n },\n [CommandType.MIGRATION_DOCUMENT]: {\n label: 'Migration Generator',\n desc: 'Generate migration document for a repository',\n doc: MulesoftToNodeJS,\n icon: ,\n requiredFields: [RequiredField.REPO],\n steps: [\n AgentTaskStatus.SUBMITTED,\n AgentTaskStatus.IN_PROGRESS,\n AgentTaskStatus.DOCUMENT_GENERATED\n ],\n codeContextOption: [CodeContextOption.WITH_REPOSITORY, CodeContextOption.UPLOAD_FROM_COMPUTER]\n },\n [CommandType.QUESTION_ANSWERING]: {\n label: 'Single Repo Code Lens',\n desc: 'Ask question for a single repository',\n doc: QuestionAnswering,\n icon: ,\n requiredFields: [RequiredField.REPO, RequiredField.BRANCH],\n steps: [\n AgentTaskStatus.SUBMITTED,\n AgentTaskStatus.IN_PROGRESS,\n AgentTaskStatus.PLANNING_COMPLETED,\n AgentTaskStatus.PLANNING_UPDATED,\n AgentTaskStatus.DIFF_GENERATED,\n AgentTaskStatus.DIFF_COMMENT_ADDED,\n AgentTaskStatus.HUMAN_DIFF_UPDATED\n ]\n },\n [CommandType.NON_REPO_AWARE_QA]: {\n label: 'API Spec Generator',\n desc: 'Generate API spec for a single API',\n doc: QuestionAnswering,\n icon: ,\n requiredFields: [],\n steps: [\n AgentTaskStatus.SUBMITTED,\n AgentTaskStatus.IN_PROGRESS,\n AgentTaskStatus.PLANNING_COMPLETED,\n AgentTaskStatus.PLANNING_UPDATED,\n AgentTaskStatus.DIFF_GENERATED,\n AgentTaskStatus.DIFF_COMMENT_ADDED,\n AgentTaskStatus.HUMAN_DIFF_UPDATED\n ]\n },\n [CommandType.MIGRATION_QUESTION_ANSWERING]: {\n label: 'Migration Repo Code Lens',\n desc: 'Ask migration questions for a repository',\n doc: QuestionAnswering,\n icon: ,\n requiredFields: [RequiredField.REPO, RequiredField.BRANCH],\n steps: [\n AgentTaskStatus.SUBMITTED,\n AgentTaskStatus.IN_PROGRESS,\n AgentTaskStatus.PLANNING_COMPLETED,\n AgentTaskStatus.PLANNING_UPDATED,\n AgentTaskStatus.DIFF_GENERATED,\n AgentTaskStatus.DIFF_COMMENT_ADDED,\n AgentTaskStatus.HUMAN_DIFF_UPDATED\n ]\n },\n [CommandType.MULTI_REPO_QA]: {\n label: 'Multi Repo Code Lens',\n desc: 'Ask question for multiple repositories',\n doc: MultiRepoQuestionAnswering,\n icon: ,\n requiredFields: [RequiredField.MULTI_REPO, RequiredField.BRANCH],\n steps: [\n AgentTaskStatus.SUBMITTED,\n AgentTaskStatus.IN_PROGRESS,\n AgentTaskStatus.PLANNING_COMPLETED,\n AgentTaskStatus.PLANNING_UPDATED,\n AgentTaskStatus.DIFF_GENERATED,\n AgentTaskStatus.DIFF_COMMENT_ADDED,\n AgentTaskStatus.HUMAN_DIFF_UPDATED\n ]\n },\n [CommandType.CODE_REVIEW]: {\n label: 'Code Review Lens',\n desc: 'Review a pull request for the provided repository',\n doc: CodeReview,\n icon: ,\n requiredFields: [RequiredField.REPO, RequiredField.BRANCH],\n steps: [AgentTaskStatus.SUBMITTED, AgentTaskStatus.IN_PROGRESS, AgentTaskStatus.COMPLETED]\n },\n [CommandType.GENERATE_MULTI_REPO_FLOW_DIAGRAM]: {\n label: 'Domain Diagram Generator',\n desc: 'Generate diagram for multiple APIs',\n doc: GenerateMultiRepoFlowDiagramFlows,\n icon: ,\n requiredFields: [RequiredField.MULTI_REPO, RequiredField.BRANCH],\n steps: [\n AgentTaskStatus.SUBMITTED,\n AgentTaskStatus.IN_PROGRESS,\n AgentTaskStatus.PLANNING_COMPLETED,\n AgentTaskStatus.PLANNING_UPDATED,\n AgentTaskStatus.DIFF_GENERATED,\n AgentTaskStatus.DIFF_COMMENT_ADDED,\n AgentTaskStatus.HUMAN_DIFF_UPDATED\n ]\n },\n [CommandType.GENERAL_MULTI_REPO_QA_DEBUG_AGENT]: {\n label: 'Multi-Repo Q&A (Debug)',\n desc: 'Ask questions for multiple repositories',\n doc: MultiRepoQuestionAnsweringDebug,\n icon: ,\n requiredFields: [RequiredField.MULTI_REPO, RequiredField.BRANCH, RequiredField.DESCRIPTION],\n steps: [\n AgentTaskStatus.SUBMITTED,\n AgentTaskStatus.IN_PROGRESS,\n AgentTaskStatus.PLANNING_COMPLETED,\n AgentTaskStatus.PLANNING_UPDATED,\n AgentTaskStatus.DIFF_GENERATED,\n AgentTaskStatus.DIFF_COMMENT_ADDED,\n AgentTaskStatus.HUMAN_DIFF_UPDATED\n ]\n },\n [CommandType.GENERATE_IMAGE]: {\n label: 'Diagram Generator',\n desc: 'Generate a sequence & flow diagram/s',\n doc: GenerateImage,\n icon: ,\n requiredFields: [RequiredField.REPO, RequiredField.BRANCH, RequiredField.DESCRIPTION],\n steps: [\n AgentTaskStatus.SUBMITTED,\n AgentTaskStatus.IN_PROGRESS,\n AgentTaskStatus.PLANNING_COMPLETED,\n AgentTaskStatus.PLANNING_UPDATED,\n AgentTaskStatus.DIFF_GENERATED,\n AgentTaskStatus.DIFF_COMMENT_ADDED,\n AgentTaskStatus.HUMAN_DIFF_UPDATED\n ],\n codeContextOption: [CodeContextOption.WITH_REPOSITORY, CodeContextOption.UPLOAD_FROM_COMPUTER]\n },\n [CommandType.GENERATE_SIMPLE_CODE_PR]: {\n label: 'Code Enhancer',\n desc: 'Make code changes to existing flows',\n doc: MdSimpleCodingTask,\n icon: ,\n requiredFields: [RequiredField.REPO, RequiredField.BRANCH, RequiredField.DESCRIPTION],\n steps: [\n AgentTaskStatus.SUBMITTED,\n AgentTaskStatus.IN_PROGRESS,\n AgentTaskStatus.PLANNING_COMPLETED,\n AgentTaskStatus.PLANNING_UPDATED,\n AgentTaskStatus.AGENT_INTERNAL_STATUS,\n AgentTaskStatus.DIFF_GENERATED,\n AgentTaskStatus.DIFF_COMMENT_ADDED,\n AgentTaskStatus.HUMAN_DIFF_UPDATED\n ],\n codeContextOption: [CodeContextOption.WITH_REPOSITORY, CodeContextOption.UPLOAD_FROM_COMPUTER]\n },\n [CommandType.GENERATE_DOCUMENTATION]: {\n label: 'Document Generator',\n desc: 'Generate documentation for flows, endpoints',\n doc: GenerateDocumentation,\n icon: ,\n requiredFields: [RequiredField.REPO, RequiredField.BRANCH, RequiredField.DESCRIPTION],\n steps: [\n AgentTaskStatus.SUBMITTED,\n AgentTaskStatus.IN_PROGRESS,\n AgentTaskStatus.PLANNING_COMPLETED,\n AgentTaskStatus.PLANNING_UPDATED,\n AgentTaskStatus.DIFF_GENERATED,\n AgentTaskStatus.DIFF_COMMENT_ADDED,\n AgentTaskStatus.HUMAN_DIFF_UPDATED\n ],\n codeContextOption: [CodeContextOption.WITH_REPOSITORY, CodeContextOption.UPLOAD_FROM_COMPUTER]\n },\n [CommandType.GENERATE_FULL_REPO_TECH_MANIFEST_DOCUMENTATION]: {\n label: 'Repository Docs Generator',\n desc: 'Generate docs for a repository',\n doc: GenerateFullRepoTechManifestDocumentation,\n icon: ,\n requiredFields: [RequiredField.REPO, RequiredField.BRANCH],\n steps: [\n AgentTaskStatus.SUBMITTED,\n AgentTaskStatus.IN_PROGRESS,\n AgentTaskStatus.PLANNING_COMPLETED,\n AgentTaskStatus.PLANNING_UPDATED,\n AgentTaskStatus.DIFF_GENERATED,\n AgentTaskStatus.DIFF_COMMENT_ADDED,\n AgentTaskStatus.HUMAN_DIFF_UPDATED\n ]\n },\n [CommandType.GENERATE_MAPPING_TABLE]: {\n label: 'Mapping Table Generator',\n desc: 'Generate mapping table from dataweave script',\n doc: GenerateMappingTable,\n icon: ,\n requiredFields: [RequiredField.DESCRIPTION],\n steps: [\n AgentTaskStatus.SUBMITTED,\n AgentTaskStatus.IN_PROGRESS,\n AgentTaskStatus.DOCUMENT_GENERATED\n ]\n },\n [CommandType.GENERATE_ADD_FLOW_CODE_PR]: {\n label: 'Integration Generator',\n desc: 'Create flow code from flow specifications and flow diagrams',\n doc: GenerateAddFlowCodePR,\n icon: ,\n requiredFields: [RequiredField.DESCRIPTION],\n steps: [\n AgentTaskStatus.SUBMITTED,\n AgentTaskStatus.IN_PROGRESS,\n AgentTaskStatus.AGENT_INTERNAL_STATUS,\n AgentTaskStatus.DOCUMENT_GENERATED,\n AgentTaskStatus.DOCUMENT_UPDATED\n ],\n codeContextGroup: CodeContextGroup.INTEGRATION,\n codeContextOption: [CodeContextOption.NO_REPOSITORY]\n },\n [CommandType.GENERATE_REPO_ADD_FLOW_CODE_PR]: {\n label: 'Integration Generator',\n desc: 'Create flow code with repository awareness',\n doc: GenerateAddFlowCodePR,\n icon: ,\n requiredFields: [RequiredField.REPO, RequiredField.BRANCH, RequiredField.DESCRIPTION],\n steps: [\n AgentTaskStatus.SUBMITTED,\n AgentTaskStatus.IN_PROGRESS,\n AgentTaskStatus.AGENT_INTERNAL_STATUS,\n AgentTaskStatus.DOCUMENT_GENERATED,\n AgentTaskStatus.DOCUMENT_UPDATED\n ],\n codeContextGroup: CodeContextGroup.INTEGRATION,\n codeContextOption: [CodeContextOption.WITH_REPOSITORY, CodeContextOption.UPLOAD_FROM_COMPUTER]\n },\n [CommandType.DATAWEAVE_TO_DATA_CREATION]: {\n label: 'Sample Data Generator',\n desc: 'Sample data from dataweave',\n doc: DataweaveToDataCreation,\n icon: ,\n requiredFields: [RequiredField.DESCRIPTION],\n steps: [AgentTaskStatus.SUBMITTED, AgentTaskStatus.IN_PROGRESS, AgentTaskStatus.COMPLETED],\n codeContextGroup: CodeContextGroup.SAMPLE_DATA,\n codeContextOption: [CodeContextOption.NO_REPOSITORY]\n },\n [CommandType.DATAWEAVE_TO_DATA_CREATION_REPO_AWARE]: {\n label: 'Sample Generator',\n desc: 'Sample data from dataweave with repository awareness',\n doc: DataweaveToDataCreation,\n icon: ,\n requiredFields: [RequiredField.DESCRIPTION, RequiredField.REPO, RequiredField.BRANCH],\n steps: [AgentTaskStatus.SUBMITTED, AgentTaskStatus.IN_PROGRESS, AgentTaskStatus.COMPLETED],\n codeContextGroup: CodeContextGroup.SAMPLE_DATA,\n codeContextOption: [CodeContextOption.WITH_REPOSITORY, CodeContextOption.UPLOAD_FROM_COMPUTER]\n },\n [CommandType.INPUT_OUTPUT_EXAMPLE_TO_DWL_GENERATION]: {\n label: 'DataWeave Generator',\n desc: 'from input output examples',\n doc: MdInputOutputToDWL,\n icon: ,\n requiredFields: [RequiredField.INPUT_OUTPUT_EXAMPLES],\n steps: [AgentTaskStatus.SUBMITTED, AgentTaskStatus.IN_PROGRESS, AgentTaskStatus.COMPLETED],\n codeContextGroup: CodeContextGroup.DATAWEAVE,\n codeContextOption: [CodeContextOption.NO_REPOSITORY]\n },\n [CommandType.INPUT_OUTPUT_EXAMPLE_TO_DWL_GENERATION_REPO_AWARE]: {\n label: 'DataWeave Generator',\n desc: 'from input output examples with repository awareness',\n doc: MdInputOutputToDWL,\n icon: ,\n requiredFields: [\n RequiredField.REPO,\n RequiredField.BRANCH,\n RequiredField.INPUT_OUTPUT_EXAMPLES\n ],\n steps: [AgentTaskStatus.SUBMITTED, AgentTaskStatus.IN_PROGRESS, AgentTaskStatus.COMPLETED],\n codeContextGroup: CodeContextGroup.DATAWEAVE,\n codeContextOption: [CodeContextOption.WITH_REPOSITORY, CodeContextOption.UPLOAD_FROM_COMPUTER]\n },\n [CommandType.GENERATE_DATAWEAVE]: {\n label: 'DataWeave Generator',\n desc: 'from mapping table',\n doc: GenerateDataweave,\n icon: ,\n requiredFields: [RequiredField.MAPPING_TABLE],\n steps: [AgentTaskStatus.SUBMITTED, AgentTaskStatus.IN_PROGRESS, AgentTaskStatus.COMPLETED],\n codeContextGroup: CodeContextGroup.DATAWEAVE,\n codeContextOption: [CodeContextOption.WITH_MAPPING_TABLE]\n },\n [CommandType.GENERATE_DATAWEAVE_REPO_AWARE]: {\n label: 'DataWeave Generator 4',\n desc: 'from mapping table with repository awareness',\n doc: GenerateDataweave,\n icon: ,\n requiredFields: [RequiredField.MAPPING_TABLE, RequiredField.REPO, RequiredField.BRANCH],\n steps: [AgentTaskStatus.SUBMITTED, AgentTaskStatus.IN_PROGRESS, AgentTaskStatus.COMPLETED]\n },\n [CommandType.MUNIT_TEST_CREATION]: {\n label: 'MUnit Test Generator',\n desc: 'Generate MUnit tests for a flow',\n doc: GenerateMUnitTestsForFlow,\n icon: ,\n requiredFields: [RequiredField.REPO, RequiredField.BRANCH, RequiredField.DESCRIPTION],\n steps: [\n AgentTaskStatus.SUBMITTED,\n AgentTaskStatus.IN_PROGRESS,\n AgentTaskStatus.PLANNING_COMPLETED,\n AgentTaskStatus.PLANNING_UPDATED,\n AgentTaskStatus.DIFF_GENERATED,\n AgentTaskStatus.DIFF_COMMENT_ADDED,\n AgentTaskStatus.HUMAN_DIFF_UPDATED\n ],\n codeContextOption: [CodeContextOption.WITH_REPOSITORY, CodeContextOption.UPLOAD_FROM_COMPUTER]\n }\n }\n return Object.entries(agentCommands).reduce((acc: TypeAgentCommands, [key, value]) => {\n const id = Number(key) as AgentCommand['id']\n acc[id] = { ...value, id: Number(key) as AgentCommand['id'] }\n return acc\n }, {} as TypeAgentCommands)\n}\n\nexport const AgentCommands = buildAgentCommands()\nexport const QuestionAnsweringCommands = [\n CommandType.QUESTION_ANSWERING,\n CommandType.MIGRATION_QUESTION_ANSWERING,\n CommandType.MULTI_REPO_QA,\n CommandType.CODE_REVIEW,\n CommandType.NON_REPO_AWARE_QA\n]\nexport const FixedPromptCommands = [\n CommandType.GENERATE_MULTI_REPO_FLOW_DIAGRAM,\n CommandType.GENERATE_FULL_REPO_TECH_MANIFEST_DOCUMENTATION,\n CommandType.GENERAL_MULTI_REPO_QA_DEBUG_AGENT\n]\n\nconst buildFormCommands = () => {\n const commands = Object.values(AgentCommands).filter(({ id }) => {\n if (QuestionAnsweringCommands.concat(FixedPromptCommands).includes(id)) {\n return false\n }\n return true\n })\n return commands.map(({ id }) => id)\n}\n\nexport const FormCommands = buildFormCommands()\n\nexport const isNoTryExampleCommand = (command?: CommandType) => {\n return [\n CommandType.GENERATE_MULTI_REPO_FLOW_DIAGRAM,\n CommandType.MULTI_REPO_QA,\n CommandType.MULESOFT_TO_CAMEL_MIGRATION,\n CommandType.MIGRATION_DOCUMENT,\n CommandType.MIGRATION_QUESTION_ANSWERING,\n CommandType.CODE_REVIEW,\n CommandType.NON_REPO_AWARE_QA\n ].includes(command as UsedCommandType)\n}\n\nexport const isRepoRequired = (command?: CommandType) => {\n return isFieldRequired(RequiredField.REPO, command)\n}\n\nexport const isFieldRequired = (requiredField: RequiredField, command?: CommandType) => {\n if (!command) return false\n const filter = ({ requiredFields }: AgentCommand) => requiredFields.includes(requiredField)\n const requiredTasks = Object.values(AgentCommands).filter(filter)\n return requiredTasks.map(({ id }) => id).includes(command as UsedCommandType)\n}\n\nexport const isRepoNotRequired = (command?: CommandType) => {\n return !isRepoRequired(command)\n}\n\nexport const isBranchRequired = (command?: CommandType) => {\n return isFieldRequired(RequiredField.BRANCH, command)\n}\n\nexport const isBranchNotRequired = (command?: CommandType) => {\n return !isBranchRequired(command)\n}\n\nexport const isTaskCommand = (command?: UsedCommandType) => {\n return !QuestionAnsweringCommands.includes(command as UsedCommandType)\n}\nexport const isChatCommand = (command?: UsedCommandType) => {\n return !isTaskCommand(command)\n}\n\nexport const isInlineChatCommand = (command?: UsedCommandType) => {\n return isTaskCommand(command) && isRepoRequired(command)\n}\n\nexport const isEitherRepoBranchNotRequired = (command: CommandType) => {\n return isRepoNotRequired(command) && isBranchNotRequired(command)\n}\n\nexport const isRepoBranchNotSatisfied = (\n repos: { index_name: string }[],\n command?: CommandType,\n repository?: string,\n branch?: string\n) => {\n const areReposEmpty = Object.keys(repos).length === 0\n const isRepoNotSatisfied = isRepoRequired(command) && (areReposEmpty || !repository)\n const isBranchNotSatisfied = isBranchRequired(command) && !branch\n return isRepoNotSatisfied || isBranchNotSatisfied\n}\n\nexport const isCodeContextNotSatisfied = (\n currentOption: 'upload' | 'codeContext',\n uploadedPath: string,\n repos: { index_name: string }[],\n repository?: string,\n branch?: string,\n command?: CommandType\n) => {\n if (currentOption === 'upload') {\n const isUploadNotSatisfied = uploadedPath == null || uploadedPath === ''\n return isRepoRequired(command) && isUploadNotSatisfied\n }\n if (currentOption === 'codeContext') {\n return isRepoBranchNotSatisfied(repos, command, repository, branch)\n }\n return false\n}\n\nexport const areRequiredFieldsNotSatisfied = (command?: CommandType, task?: TaskParams | null) => {\n const description = task?.request?.command?.commandString || ''\n const descriptionTrimmed = description.replace(/\\s/g, '')\n const isDescriptionMissing =\n isFieldRequired(RequiredField.DESCRIPTION, command) && (!task || descriptionTrimmed === '')\n const isMappingTableMissing =\n isFieldRequired(RequiredField.MAPPING_TABLE, command) &&\n (!task || task.request?.mappingSheet?.length === 0)\n const isInputOutputMissing =\n isFieldRequired(RequiredField.INPUT_OUTPUT_EXAMPLES, command) &&\n (!task ||\n !task.request?.sourceOutputExamples?.[0]?.sourceData ||\n !task.request?.sourceOutputExamples?.[0]?.sourceData)\n\n return isDescriptionMissing || isMappingTableMissing || isInputOutputMissing\n}\n\nexport { CommandType }\n","import { useQuery } from '@tanstack/react-query'\nimport groupBy from 'lodash/groupBy'\nimport { useEffect } from 'react'\nimport { CommandType } from '~/constants/commands'\nimport { DefaultVersion, JavaVersion, MavenVersion } from '~/constants/settings'\nimport { commandTypeToJSON } from '~/protos/agents'\nimport { getIndexes } from '~/services/organizationService'\nimport { QueryKeys } from '~/services/queryClient'\nimport { Index, IndexStatus } from '~/types/Indexes'\nimport { BetterToast, ToastIds } from '~/utils/toast'\nimport { useConversationMetadata } from '../conversation'\n\nexport interface FlatIndex extends Index {\n index_name: string\n index_branch: string\n repo_name: string\n org_name: string\n branch_name: string\n java_version: JavaVersion\n maven_version: MavenVersion\n settings_xml_raw_txt: string\n settings_security_xml_raw_txt: string\n}\n\ninterface UseIndexProps {\n exculdeInternalRepos?: boolean\n commandType?: CommandType\n}\n\nexport function useIndexes({\n exculdeInternalRepos = false,\n commandType = CommandType.UNRECOGNIZED\n}: UseIndexProps = {}) {\n const { data: indexes } = useQuery({\n queryKey: QueryKeys.Indexes.concat([\n commandTypeToJSON(commandType as CommandType),\n exculdeInternalRepos.toString()\n ]),\n queryFn: getIndexes,\n initialData: [] as Index[],\n refetchInterval: 1000 * 5,\n select(data: Index[]) {\n return data\n .filter(index => {\n if (exculdeInternalRepos) {\n return index.indexer_metadata?.is_internal_uploaded_index === false\n }\n return true\n })\n .map(index => {\n const runtimeSetting = index.indexer_metadata\n ? index.indexer_metadata.runtime_setting\n : {\n java_version: DefaultVersion.javaVersion,\n maven_version: DefaultVersion.mavenVersion,\n settings_xml_raw_txt: '',\n settings_security_xml_raw_txt: ''\n }\n return {\n ...index,\n index_name: index.name.name,\n index_branch: index.name.branch,\n org_name: index.name.name.split('/')[0],\n repo_name: index.name.name.split('/')[1],\n branch_name: index.name.branch,\n java_version: runtimeSetting.java_version,\n maven_version: runtimeSetting.maven_version,\n settings_xml_raw_txt: runtimeSetting.settings_xml_raw_txt,\n settings_security_xml_raw_txt: runtimeSetting.settings_security_xml_raw_txt\n } as FlatIndex\n })\n }\n })\n\n // Code Review agent and Migration Document agent are not supported for local sync indexes\n if (\n commandType &&\n [CommandType.MIGRATION_DOCUMENT, CommandType.CODE_REVIEW].includes(commandType)\n ) {\n const inddexesToBeReturn = indexes.filter(index => index.conn.conn_type !== 'local_sync')\n return inddexesToBeReturn\n }\n\n return indexes\n}\n\nexport function useIndexesToast() {\n const indexes = useIndexes()\n useEffect(() => {\n const successIndexes = indexes.filter(index => index.status === IndexStatus.SUCCEEDED)\n if (indexes.length !== 0 && successIndexes.length === 0) {\n BetterToast.stickyError({\n id: ToastIds.IndexingRepositories,\n message: 'No repositories available',\n loading: true\n })\n } else {\n BetterToast.dismiss(ToastIds.IndexingRepositories)\n }\n }, [indexes])\n}\n\nexport function useInrogressIndexes() {\n const indexes = useIndexes()\n return indexes.filter(index => {\n return [IndexStatus.IN_PROGRESS, IndexStatus.INITIALIZED].includes(index.status)\n })\n}\n\nexport function useFinishedIndexes({\n exculdeInternalRepos = false,\n commandType = CommandType.UNRECOGNIZED\n}: UseIndexProps = {}) {\n const indexes = useIndexes({ exculdeInternalRepos, commandType })\n const successIndexes = indexes.filter(index => index.status === IndexStatus.SUCCEEDED)\n const branches = branchesByConnTypeAndIndexName(successIndexes)\n\n return {\n branches,\n repos: getReposFromBranches(branches)\n } as const\n}\n\nexport function useInProgressIndexes() {\n const indexes = useIndexes()\n return indexes.filter(index => {\n return [IndexStatus.IN_PROGRESS, IndexStatus.INITIALIZED].includes(index.status)\n })\n}\n\nfunction branchesByConnTypeAndIndexName(\n indexes: FlatIndex[]\n): Record> {\n const indexesByConnType = groupBy(indexes, 'conn.conn_type')\n return Object.fromEntries(\n Object.entries(indexesByConnType).map(([connType, connIndexes]) => {\n const repos = Object.fromEntries(\n Object.entries(groupBy(connIndexes, 'index_name')).map(([repoName, repoIndexes]) => {\n return [repoName, repoIndexes.map(index => index.index_branch)]\n })\n )\n return [connType, repos]\n })\n )\n}\n\nfunction getReposFromBranches(\n branches: Record>\n): { index_name: string; conn_type: string }[] {\n return Object.entries(branches).flatMap(([conn_type, repos]) =>\n Object.keys(repos).map(index_name => ({ conn_type, index_name }))\n )\n}\n\nexport function checkIsInternalUploadedIndex(\n indexes: FlatIndex[],\n repository: string | undefined,\n branch: string | undefined\n) {\n const index = indexes.find(\n index => index.name.name === repository && index.name.branch === branch\n )\n\n if (index != null) {\n return index.indexer_metadata?.is_internal_uploaded_index ?? false\n }\n return false\n}\n\nexport function checkIsLocalSyncIndex(\n indexes: FlatIndex[],\n repository: string | undefined,\n branch: string | undefined\n) {\n const index = indexes.find(\n index => index.name.name === repository && index.name.branch === branch\n )\n\n if (index != null) {\n return index.conn.conn_type === 'local_sync'\n }\n return false\n}\n\nexport function useIsInternalUploadedIndex() {\n const indexes = useIndexes()\n const { repository, branch } = useConversationMetadata()\n\n return checkIsInternalUploadedIndex(indexes, repository, branch)\n}\n\nexport function useIsLocalSyncIndex() {\n const indexes = useIndexes()\n const { repository, branch } = useConversationMetadata()\n\n return checkIsLocalSyncIndex(indexes, repository, branch)\n}\n","import { Conversation, ConversationMetadata, ConversationWithMessages } from '~/types/Conversations'\nimport { fetchWrapper } from '~/utils/fetchWrapper'\n\nexport const getConversations = async () => {\n const response = await fetchWrapper('/api/conversations', {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to get conversations. Reason: ${reason}`)\n }\n const data = await response.json()\n return data as Conversation[]\n}\n\ntype UpdateConversationMetadata = {\n uuid: string\n metadata: ConversationMetadata\n}\n\nexport interface ConversationsResponse {\n data: Conversation[]\n next_cursor: number | null\n has_more: boolean\n}\n\nexport async function updateConversationMetadata({ uuid, metadata }: UpdateConversationMetadata) {\n const path = `/api/conversation/${uuid}/metadata`\n const response = await fetchWrapper(path, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(metadata)\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to get conversations. Reason: ${reason}`)\n }\n}\n\ninterface ConversationOptions {\n conversation_uuid?: string\n initialized?: boolean\n}\n\ninterface UpdateConversationOptions {\n conversation_uuid: string\n initialized?: boolean\n exit_new_conversation_uuid: string\n}\n\nexport const getNewConversation = async (options: ConversationOptions = {}) => {\n const path = '/api/conversation/new'\n const response = await fetchWrapper(path, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(options)\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to get conversations. Reason: ${reason}`)\n }\n const data = await response.json()\n return data as Conversation\n}\n\nexport const updateNewConversation = async (options: UpdateConversationOptions) => {\n const path = '/api/conversation/update'\n const response = await fetchWrapper(path, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(options)\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to update conversations. Reason: ${reason}`)\n }\n const data = await response.json()\n return data as Conversation\n}\n\nexport const updateConversationTitle = async (payload: { uuid: string; title: string }) => {\n const { uuid, ...body } = payload\n const path = `/api/conversation/${uuid}/title`\n const response = await fetchWrapper(path, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(body)\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to update conversation title. Reason: ${reason}`)\n }\n const { data } = await response.json()\n return data as { title: string }\n}\n\nexport const generateConversationTitle = async (payload: { uuid: string; text: string }) => {\n const { uuid, ...body } = payload\n const path = `/api/conversation/${uuid}/generate-title`\n const response = await fetchWrapper(path, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(body)\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to generate conversation title. Reason: ${reason}`)\n }\n const data = await response.json()\n return data as { title: string }\n}\n\ninterface WithAbortSignal {\n uuid: string\n signal: AbortSignal\n}\n\nexport const getConversationDetails = async ({ uuid, signal }: WithAbortSignal) => {\n const path = `/api/conversation/${uuid}`\n const response = await fetchWrapper(path, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json'\n },\n signal\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to get conversation details. Reason: ${reason}`)\n }\n const data = await response.json()\n return data as ConversationWithMessages\n}\n\nexport const getConversationsPaginated = async (lastTimestamp?: number): Promise => {\n const params = new URLSearchParams()\n if (lastTimestamp) {\n params.append('last_timestamp', lastTimestamp.toString())\n }\n params.append('page_size', '100')\n const path = `/api/conversations/paginated?${params.toString()}`\n \n const response = await fetchWrapper(path, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n \n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to get paginated conversations. Reason: ${reason}`)\n }\n \n const data = await response.json()\n return data as ConversationsResponse\n}\n\nexport const deleteConversation = async (uuid: string) => {\n const path = `/api/conversation/${uuid}`\n const response = await fetchWrapper(path, {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to delete conversation. Reason: ${reason}`)\n }\n}","import { Index, IndexStatus } from '~/types/Indexes'\nimport {\n BillingInfo,\n ConnAccessToken,\n CustomConnectionParam,\n IndexRuntimeSettings,\n Repository,\n RuntimeSetting,\n TestConnection\n} from '~/types/ResponseType'\nimport { fetchWrapper } from '~/utils/fetchWrapper'\nimport { UploadFileOptions } from './campaignService'\n\nexport async function uploadCodingGuidelines(file: File, options: UploadFileOptions) {\n const { onProgress = () => {}, onComplete = (path: string) => {}, onError = () => {} } = options\n const formData = new FormData()\n formData.append('file', file)\n\n try {\n const response = await fetchWrapper('/api/org/upload-coding-guidelines', {\n method: 'PUT',\n body: formData\n })\n\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`)\n }\n\n const reader = response.body?.getReader()\n if (!reader) {\n throw new Error('Response body is not readable')\n }\n\n while (true) {\n const { done, value } = await reader.read()\n if (done) break\n\n const chunk = new TextDecoder().decode(value)\n const lines = chunk.split('\\n').filter(line => line.trim() !== '')\n\n for (const line of lines) {\n const data = JSON.parse(line)\n if (data.error) {\n onError(data.error)\n return\n }\n if (data.progress) {\n onProgress(data.progress)\n }\n if (data.status === 'completed') {\n onComplete(data.path)\n return\n }\n }\n }\n } catch (error) {\n onError(error instanceof Error ? error.message : 'An unknown error occurred')\n }\n}\n\nexport const getOrgUsers = async () => {\n const response = await fetchWrapper('/api/org/users', {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n if (response.status !== 200) {\n throw new Error('Failed to get organization users')\n }\n return response.json()\n}\n\nexport const getOrgRepos = async (conn_type: string) => {\n conn_type = conn_type.toLowerCase()\n const response = await fetchWrapper(`/api/conn/${conn_type}/repos`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n if (!response.ok) {\n const error = await response.text()\n throw new Error('Failed to get repositories. Reason: ' + error)\n }\n const repos = await response.json()\n return repos as string[]\n}\n\nexport const getRepoBranches = async (\n conn_type: string,\n full_name: string,\n page: number,\n search: string = '',\n cursor: string = '',\n options: { signal?: AbortSignal } = {}\n) => {\n conn_type = conn_type.toLowerCase()\n const params = new URLSearchParams({\n full_name,\n page: page.toString(),\n search,\n cursor\n }).toString()\n const response = await fetchWrapper(`/api/conn/${conn_type}/branches?${params}`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json'\n },\n signal: options.signal\n })\n if (!response.ok) {\n const error = await response.text()\n throw new Error(error)\n }\n const data = await response.json()\n\n return data\n}\n\nexport const updateOrgRepos = async (conn_type: string, repos: Repository[]) => {\n conn_type = conn_type.toLowerCase()\n const response = await fetchWrapper(`/api/conn/${conn_type}/repos`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(repos)\n })\n if (!response.ok) {\n throw new Error('Failed to update authorized branch')\n }\n}\n\nexport const getIndexes = async () => {\n const response = await fetchWrapper(`/api/org/index`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n if (!response.ok) {\n const error = await response.text()\n throw new Error(error)\n }\n const data: Index[] = await response.json()\n return data\n}\n\nexport const updateIndexStatus = async (index: { id: number; status: IndexStatus }) => {\n const response = await fetchWrapper(`/api/org/indexes/${index.id}/update`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({ status: index.status })\n })\n if (!response.ok) {\n const error = await response.text()\n throw new Error(error)\n }\n}\n\nexport const getUserOrganizations = async () => {\n const response = await fetchWrapper('/api/org/orgs', {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n if (!response.ok) {\n throw new Error('Failed to get user organizations')\n }\n const data = await response.json()\n return data\n}\n\nexport const switchOrganization = async (payload: { org_id: number }) => {\n const { org_id } = payload\n const path = `/api/org/switch-org`\n const response = await fetchWrapper(path, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({ org_id: org_id })\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to change organization. Reason: ${reason}`)\n }\n return response.json()\n}\n\nexport const createOrganization = async (payload: { org_name: string }) => {\n const { org_name } = payload\n const path = `/api/org/add-org`\n const response = await fetchWrapper(path, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({ org_name: org_name })\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to create organization. Reason: ${reason}`)\n }\n}\n\nexport const changeOrgName = async (payload: { org_name: string }) => {\n const { org_name } = payload\n const path = `/api/org/update-org-name`\n const response = await fetchWrapper(path, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({ org_name: org_name })\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to update organization name. Reason: ${reason}`)\n }\n const data = await response.json()\n return data\n}\n\nexport const changeSSOClientID = async (payload: { client_id: string; callback_url: string }) => {\n const { client_id, callback_url } = payload\n const path = `/api/org/update-org-sso-clientID`\n const response = await fetchWrapper(path, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({ client_id: client_id, callback_url: callback_url })\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to update SSO Client ID. Reason: ${reason}`)\n }\n const data = await response.json()\n return data\n}\n\nexport const changeSSOClientSecret = async (payload: {\n client_secret: string\n callback_url: string\n}) => {\n const { client_secret, callback_url } = payload\n const path = `/api/org/update-org-sso-client-secret`\n const response = await fetchWrapper(path, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({ client_secret: client_secret, callback_url: callback_url })\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to update SSO Client Secret. Reason: ${reason}`)\n }\n const data = await response.json()\n return data\n}\n\nexport const changeSSOTenantID = async (payload: {\n client_tenantid: string\n callback_url: string\n}) => {\n const { client_tenantid, callback_url } = payload\n const path = `/api/org/update-org-sso-tenant-id`\n const response = await fetchWrapper(path, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({ client_tenantid: client_tenantid, callback_url: callback_url })\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to update SSO Tenant ID. Reason: ${reason}`)\n }\n const data = await response.json()\n return data\n}\n\nexport const changeSSOCallBackUrl = async (payload: { callback_url: string }) => {\n const { callback_url } = payload\n const path = `/api/org/update-org-sso-call-back-url`\n const response = await fetchWrapper(path, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({ callback_url: callback_url })\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to update SSO Callback Url. Reason: ${reason}`)\n }\n const data = await response.json()\n return data\n}\n\nexport const updateCustomConnection = async (payload: CustomConnectionParam) => {\n const reqParam = {\n conn_type: payload.connType,\n client_id: payload.clientId,\n client_secret: payload.clientSecret,\n server_url: payload.serverUrl,\n redirect_url: payload.redirectUrl,\n api_key: payload.apiKey\n }\n const path = `/api/conn/update-connection`\n const response = await fetchWrapper(path, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(reqParam)\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to update custom connection. Reason: ${reason}`)\n }\n const data = await response.json()\n return data\n}\n\nexport const setConnAccessToken = async (accessToken: ConnAccessToken) => {\n const reqParam = {\n token: accessToken.token\n }\n let connType = accessToken.connType\n const path = `/api/conn/${connType}/set-access-token`\n const response = await fetchWrapper(path, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(reqParam)\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to set connection access token. Reason: ${reason}`)\n }\n const data = await response.json()\n return data\n}\n\nexport const testConnection = async (testConnection: TestConnection) => {\n const reqParam = {\n token: testConnection.token,\n server_url: testConnection.serverUrl\n }\n let conn_type = testConnection.conn_type\n const path = `/api/conn/${conn_type}/validate-token`\n const response = await fetchWrapper(path, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(reqParam)\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to test connection. Reason: ${reason}`)\n }\n const data = await response.json()\n return data\n}\n\nexport const getConnectionMetadataList = async () => {\n const path = `/api/conn/get-connection-metadata`\n const response = await fetchWrapper(path, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to get connection metadata list. Reason: ${reason}`)\n }\n const data = await response.json()\n return data\n}\n\nexport const getOrganizationPlan = async () => {\n const path = `/api/org/plan`\n const response = await fetchWrapper(path, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n if (!response.ok) {\n throw new Error('Failed to get user organizations')\n }\n const data = await response.json()\n return data\n}\n\nexport const changeSessionTimeOut = async (timeout: number) => {\n const reqParam = {\n timeout: timeout\n }\n const path = `/api/org/set-timeout`\n const response = await fetchWrapper(path, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(reqParam)\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to set session timeout. Reason: ${reason}`)\n }\n const data = await response.json()\n return data\n}\n\nexport const getSelectedBranches = async (conn_type: string) => {\n const path = `/api/conn/${conn_type}/selected-branches`\n const response = await fetchWrapper(path, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to get updated branch. Reason: ${reason}`)\n }\n const data = await response.json()\n return data\n}\n\nexport const changeRuntimeSetting = async (runtimeSetting: RuntimeSetting) => {\n const path = `/api/org/update-runtime-setting`\n const response = await fetchWrapper(path, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(runtimeSetting)\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to update runtime setting. Reason: ${reason}`)\n }\n const data = await response.json()\n return data\n}\n\nexport const changeIndexRuntimeSetting = async (payload: {\n index_id: number\n runtimeSetting: IndexRuntimeSettings\n}) => {\n const { index_id, runtimeSetting } = payload\n const path = `/api/org/indexes/${index_id}/update-runtime-setting`\n const response = await fetchWrapper(path, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(runtimeSetting)\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to update index runtime setting. Reason: ${reason}`)\n }\n const data = await response.json()\n return data\n}\n\nexport const getCustomConnectionConfig = async (conn_type: string) => {\n const path = `/api/conn/${conn_type}/get-custom-connection-config`\n const response = await fetchWrapper(path, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to get custom connection config. Reason: ${reason}`)\n }\n const data = await response.json()\n return data\n}\n\nexport const unlockUserAccount = async (email: string) => {\n const response = await fetchWrapper('/api/v1/user/unlock-account', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({ emailToUnlock: email })\n })\n\n if (!response.ok) {\n const error = await response.text()\n throw new Error(error)\n }\n\n return response.json()\n}\n\nexport interface OrgRepo {\n filename: string\n path: string\n uploaded_at: string\n}\n\nexport async function uploadOrgRepo(file: File, options: UploadFileOptions) {\n const { onProgress = () => {}, onComplete = (path: string) => {}, onError = () => {} } = options\n const formData = new FormData()\n formData.append('file', file)\n\n try {\n const response = await fetch('/api/org/org-repos', {\n method: 'PUT',\n body: formData\n })\n\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`)\n }\n\n const reader = response.body?.getReader()\n if (!reader) {\n throw new Error('Response body is not readable')\n }\n\n while (true) {\n const { done, value } = await reader.read()\n if (done) break\n\n const chunk = new TextDecoder().decode(value)\n const lines = chunk.split('\\n').filter(line => line.trim() !== '')\n\n for (const line of lines) {\n const data = JSON.parse(line)\n if (data.error) {\n onError(data.error)\n return\n }\n if (data.progress) {\n onProgress(data.progress)\n }\n if (data.status === 'completed') {\n onComplete(data.path)\n return\n }\n }\n }\n } catch (error) {\n onError(error instanceof Error ? error.message : 'An unknown error occurred')\n }\n}\n\nexport async function listOrgRepos(): Promise<{ repositories: OrgRepo[] }> {\n const response = await fetchWrapper('/api/org/org-repos', {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n\n if (!response.ok) {\n const error = await response.text()\n throw new Error(error)\n }\n\n return response.json()\n}\n\nexport async function deleteOrgRepo(filename: string) {\n const params = new URLSearchParams({ filename }).toString()\n const response = await fetchWrapper(`/api/org/org-repos?${params}`, {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n\n if (!response.ok) {\n const error = await response.text()\n throw new Error(error)\n }\n\n return response.json()\n}\n\nexport interface DeviceRepo {\n filename: string\n path: string\n uploaded_at: string\n}\n\nexport async function uploadDeviceRepo(file: File, options: UploadFileOptions) {\n const { onProgress = () => {}, onComplete = (path: string) => {}, onError = () => {} } = options\n const formData = new FormData()\n formData.append('file', file)\n const deviceId = window.getDeviceId()\n\n try {\n const response = await fetch(`/api/org/org-repos/${deviceId}`, {\n method: 'PUT',\n body: formData\n })\n\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`)\n }\n\n const reader = response.body?.getReader()\n if (!reader) {\n throw new Error('Response body is not readable')\n }\n\n while (true) {\n const { done, value } = await reader.read()\n if (done) break\n\n const chunk = new TextDecoder().decode(value)\n const lines = chunk.split('\\n').filter(line => line.trim() !== '')\n\n for (const line of lines) {\n const data = JSON.parse(line)\n if (data.error) {\n onError(data.error)\n return\n }\n if (data.progress) {\n onProgress(data.progress)\n }\n if (data.status === 'completed') {\n onComplete(data.path)\n return\n }\n }\n }\n } catch (error) {\n onError(error instanceof Error ? error.message : 'An unknown error occurred')\n }\n}\n\nexport async function listDeviceRepos(): Promise<{ repositories: DeviceRepo[] }> {\n const deviceId = window.getDeviceId()\n const response = await fetchWrapper(`/api/org/org-repos/${deviceId}`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n\n if (!response.ok) {\n const error = await response.text()\n throw new Error(error)\n }\n\n return response.json()\n}\n\nexport async function deleteDeviceRepo(filename?: string, filesToKeep?: string[]) {\n const deviceId = window.getDeviceId()\n const params = filename ? `?${new URLSearchParams({ filename }).toString()}` : ''\n const response = await fetchWrapper(`/api/org/org-repos/${deviceId}?${params}`, {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(filesToKeep ?? [])\n })\n\n if (!response.ok) {\n const error = await response.text()\n throw new Error(error)\n }\n\n return response.json()\n}\n\nexport const updateUserRole = async (userId: number, role: string) => {\n const response = await fetchWrapper('/api/org/update-org-user-role', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n user_id: userId,\n role: role\n })\n })\n\n if (!response.ok) {\n const error = await response.json()\n throw new Error(error.detail || 'Update user role failed')\n }\n\n return response.json()\n}\n\nexport const getBillingInfo = async () => {\n const response = await fetchWrapper(`/api/org/billing-info`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n if (!response.ok) {\n const error = await response.text()\n throw new Error(error)\n }\n const data: BillingInfo = await response.json()\n return data\n}\n\nexport const updateBillingInfo = async (\n billing_id: number,\n billing_to: string,\n billing_email: string\n) => {\n const reqParam = {\n id: billing_id,\n billing_to: billing_to,\n billing_email: billing_email\n }\n const path = `/api/org/update-billing-info`\n const response = await fetchWrapper(path, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(reqParam)\n })\n if (!response.ok) {\n const reason = await response.text()\n throw new Error(`Failed to update-billing-info. Reason: ${reason}`)\n }\n const data = await response.json()\n return data\n}\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cm(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n\nexport function generateAvatar(username: string): string {\n const canvas: HTMLCanvasElement = document.createElement('canvas')\n canvas.width = 40\n canvas.height = 40\n const context: CanvasRenderingContext2D | null = canvas.getContext('2d')\n\n if (context) {\n context.fillStyle = '#f9f1f8'\n context.fillRect(0, 0, canvas.width, canvas.height)\n\n context.font = '20px Arial'\n context.fillStyle = '#000000'\n context.textAlign = 'center'\n context.textBaseline = 'middle'\n\n const initials: string = username\n .split(' ')\n .map(name => name[0])\n .join('')\n\n context.fillText(initials, canvas.width / 2, canvas.height / 2)\n }\n\n return canvas.toDataURL()\n}\n\nexport function verifyEmail(email: string): boolean {\n const emailRegex =\n /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])/\n return emailRegex.test(email)\n}\n\nexport function verifyUUID(uuid: string): boolean {\n const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i\n return uuidRegex.test(uuid)\n}\n\nexport const PublicPagePaths = [\n 'input-output-to-dwl',\n 'dwl-sample-data-generator',\n 'flow-doc-generator',\n 'master-license-agreement',\n 'test-drive',\n 'privacy',\n 'terms',\n 'mt-to-dwl',\n 'signup',\n 'signin',\n 'login',\n 'verify-email'\n]\n\nexport const isCampaignUuid = (uuid?: string) => {\n if (uuid == null) return false\n return PublicPagePaths.includes(uuid)\n}\n\nexport const isPublicPath = () => {\n const { pathname } = new URL(location.href)\n return PublicPagePaths.includes(pathname.replace('/', ''))\n}\n\nexport const isProtectedPath = () => {\n return !isPublicPath()\n}\n\nconst protectedRoutes = [\n '/api/user/unlock-account',\n '/api/user/profile',\n '/api/user/delete-account',\n '/api/user/generate-mfa-secret',\n '/api/user/verify-mfa-code',\n '/api/user/sessions',\n '/api/user/access-logs',\n '/api/org/users',\n '/api/org/add-org',\n '/api/org/update-org-name',\n '/api/org/update-org-sso-clientID',\n '/api/org/update-org-sso-client-secret',\n '/api/org/update-org-sso-tenant-id',\n '/api/org/update-org-sso-call-back-url',\n '/api/org/orgs',\n '/api/org/update-org-user-role',\n '/api/org/index',\n '/api/org/switch-org',\n '/api/org/set-timeout',\n '/api/org/update-runtime-setting',\n '/api/org/upload-coding-guidelines',\n '/api/org/invitation',\n '/api/org/org-repos',\n '/api/file/convert',\n '/api/file/upload',\n '/api/conn/update-connection',\n '/api/conn/get-connection-metadata',\n '/api/conversation/flow-names',\n '/api/conversation/flow-names-test-drive',\n '/api/conversation/new',\n '/api/conversation/update',\n '/api/conversations/',\n '/api/conversations/paginated',\n '/api/kb/annotation',\n '/api/super-admin/csv/signups',\n '/api/super-admin/csv/last-active-users',\n '/api/super-admin/csv/user-activities',\n '/api/super-admin/lookup/email-access-logs',\n '/api/super-admin/lookup/uuid-user',\n '/api/super-admin/settings/campaigns-agent-type',\n '/api/super-admin/billingList',\n '/api/super-admin/billing/update-billing-type',\n '/api/super-admin/tasks/domains',\n '/api/super-admin/tasks/emails',\n '/api/super-admin/tasks/workspaces',\n '/api/super-admin/heartbeat',\n]\n\nconst protectRouteSchemas = [\n '/api/org/indexes/{index_id}/update',\n '/api/org/indexes/{index_id}/update-runtime-setting',\n '/api/file/{file_id}',\n '/api/conn/{conn_type}/repos',\n '/api/conn/{conn_type}/branches',\n '/api/conn/{conn_type}/selected-branches',\n '/api/conn/{conn_type}/repos',\n '/api/conn/{conn_type}/set-access-token',\n '/api/conn/{conn_type}/get-custom-connection-config',\n '/api/conn/{conn_type}/validate-token',\n '/api/conversation/{conversation_uuid}/task-submit',\n '/api/conversation/{conversation_uuid}/task-update/{status}',\n '/api/conversation/{conversation_uuid}',\n '/api/conversation/{conversation_uuid}/title',\n '/api/conversation/{conversation_uuid}/generate-title',\n '/api/conversation/{conversation_uuid}/metadata',\n '/api/conversation/{conversation_uuid}',\n '/api/conversation/{conversation_uuid}/chat'\n]\n\nconst compiledProtectedRoutes = protectRouteSchemas.map(route => {\n return new RegExp(`^${route.replace(/\\{([^\\}]+)\\}/g, '([^/]+)').replace(/\\//g, '\\\\/')}$`)\n})\n\nexport const isProtectedAPIRoutePath = (url: string) => {\n return protectedRoutes.includes(url) || compiledProtectedRoutes.some(regex => regex.test(url))\n}\n\nexport const isValidString = (str: string | undefined | null) => {\n return str && str.trim() !== ''\n}\n\nexport const isChrome = () => {\n const userAgent = navigator.userAgent.toLowerCase();\n\n // Check if browser is Chrome but not Edge/Opera/Brave (which also use Chromium)\n const isChromeBrowser = /chrome/.test(userAgent)\n && !/edg/.test(userAgent) // Not Edge\n && !/opr/.test(userAgent) // Not Opera\n && !/brave/.test(userAgent); // Not Brave\n\n return isChromeBrowser;\n};"],"names":["CurieTextarea","extendVariants","Textarea","CodeContextGroup","AgentCommands","Object","CommandType","MulesoftToNodeJS","NodeJsIcon","AgentTaskStatus","MulesoftToCamel","ApacheCamelIcon","MigrationIcon","QuestionAnswering","ChatIcon","MultiRepoQuestionAnswering","CodeReview","CodeIcon","GenerateMultiRepoFlowDiagramFlows","DiagramIcon","MultiRepoQuestionAnsweringDebug","RiQuestionAnswerLine","GenerateImage","MdSimpleCodingTask","GenerateDocumentation","DocumentIcon","GenerateFullRepoTechManifestDocumentation","RepositoryIcon","GenerateMappingTable","TableIcon","GenerateAddFlowCodePR","DataweaveToDataCreation","TestIcon","MdInputOutputToDWL","GenerateDataweave","GenerateMUnitTestsForFlow","acc","key","value","Number","QuestionAnsweringCommands","FixedPromptCommands","commands","id","isRepoRequired","command","isFieldRequired","requiredField","requiredTasks","requiredFields","isRepoNotRequired","isBranchRequired","isTaskCommand","useIndexes","exculdeInternalRepos","commandType","indexes","useQuery","QueryKeys","commandTypeToJSON","getIndexes","data","index","runtimeSetting","DefaultVersion","useIsInternalUploadedIndex","repository","branch","useConversationMetadata","checkIsInternalUploadedIndex","useIsLocalSyncIndex","checkIsLocalSyncIndex","getConversationsPaginated","lastTimestamp","params","URLSearchParams","path","response","fetchWrapper","reason","Error","getOrgUsers","deleteDeviceRepo","filename","filesToKeep","deviceId","window","JSON","cm","inputs","twMerge","clsx","generateAvatar","username","canvas","document","context","initials","name","verifyEmail","email","emailRegex","verifyUUID","uuid","uuidRegex","PublicPagePaths","isCampaignUuid","isPublicPath","pathname","URL","location","protectedRoutes","compiledProtectedRoutes","protectRouteSchemas","route","RegExp","isProtectedAPIRoutePath","url","regex"],"mappings":"oWAsCO,IAAMA,EAAgBC,AAAAA,GAAAA,EAAAA,CAAAA,AAAAA,EAAeC,EAAAA,CAAQA,CAAE,CACpD,SAAU,CACR,MAAO,CACL,MAAO,CACL,aAAc,CACZ,+DACA,mFACA,yCACA,gDACA,2EACA,2BACA,aACA,+DACA,UACA,kBACD,CACD,MAAO,sDACT,CACF,CACF,EACA,gBAAiB,CACf,MAAO,QACP,SAAU,OACV,YAAa,EACf,CACF,G,gMCEYC,E,iPAAAA,G,CAAAA,E,6GAAAA,GAkXL,IAAMC,EAPJC,OAAO,OAAO,CA9U2D,CAC9E,CAACC,EAAAA,EAAAA,CAAAA,kCAA8C,CAAC,CAAE,CAChD,MAAO,sBACP,KAAM,+CACN,IAAKC,EAAAA,CAAgBA,CACrB,KAAM,UAACC,EAAAA,EAAUA,CAAAA,CAAAA,GACjB,eAAgB,C,OAAoB,CACpC,MAAO,CAACC,EAAAA,CAAAA,CAAAA,SAAyB,CAAEA,EAAAA,CAAAA,CAAAA,WAA2B,CAAEA,EAAAA,CAAAA,CAAAA,SAAyB,CAAC,AAC5F,EACA,CAACH,EAAAA,EAAAA,CAAAA,2BAAuC,CAAC,CAAE,CACzC,MAAO,oBACP,KAAM,8CACN,IAAKI,EAAAA,CAAeA,CACpB,KAAM,UAACC,EAAAA,EAAeA,CAAAA,CAAAA,GACtB,eAAgB,C,8BAAq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