Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

1.8 KB
Raw Blame
import { atom } from 'jotai'
import { atomWithLazy } from 'jotai/utils'
import { TASK_DRAWER_LIMIT } from '../tasks/drawer-model'
import { createTaskProgressStore } from '../tasks/progress-store'
import { createTaskRuntimeState } from '../tasks/runtime-state'
import { documentBulkPendingActionAtom } from './bulk'
import {
  documentRequestSearchAtom,
  documentsDownloadPermissionAtom,
  documentsKnowledgeSpaceIdAtom,
  documentsSpaceContextAtom,
} from './inputs'
import { documentRowPendingActionsAtom } from './row-actions'
import {
  documentModelReadyActionAtom,
  documentPermissionRecoveryStateOverrideAtom,
  documentTaskRuntimeBridgeAtom,
} from './runtime'
import { documentUploadingAtom } from './upload'

export const documentTasksOpenAtom = atom(false)
export const documentTaskDrawerVisibleLimitAtom = atom(TASK_DRAWER_LIMIT)
export const documentDependencyRetryRequestAtom = atom({ sources: false })
export const documentPermissionRecoveryFocusRequestAtom = atom<string | undefined>()
export const selectedDocumentIdsAtom = atom<Set<string>>(new Set<string>())
export const taskRuntimeStateAtom = atomWithLazy(createTaskRuntimeState)
export const taskProgressStoreAtom = atomWithLazy(createTaskProgressStore)

export const documentsScopedAtoms = [
  documentRequestSearchAtom,
  documentsKnowledgeSpaceIdAtom,
  documentsSpaceContextAtom,
  documentsDownloadPermissionAtom,
  documentTasksOpenAtom,
  documentTaskDrawerVisibleLimitAtom,
  documentDependencyRetryRequestAtom,
  documentPermissionRecoveryFocusRequestAtom,
  selectedDocumentIdsAtom,
  taskRuntimeStateAtom,
  taskProgressStoreAtom,
  documentPermissionRecoveryStateOverrideAtom,
  documentTaskRuntimeBridgeAtom,
  documentModelReadyActionAtom,
  documentUploadingAtom,
  documentBulkPendingActionAtom,
  documentRowPendingActionsAtom,
] as const