|
|
|
@ -30,6 +30,11 @@ import type { WorkflowSliceShape } from './workflow-slice'
|
|
|
|
import { createWorkflowSlice } from './workflow-slice'
|
|
|
|
import { createWorkflowSlice } from './workflow-slice'
|
|
|
|
import { WorkflowContext } from '@/app/components/workflow/context'
|
|
|
|
import { WorkflowContext } from '@/app/components/workflow/context'
|
|
|
|
import type { WorkflowSliceShape as WorkflowAppSliceShape } from '@/app/components/workflow-app/store/workflow/workflow-slice'
|
|
|
|
import type { WorkflowSliceShape as WorkflowAppSliceShape } from '@/app/components/workflow-app/store/workflow/workflow-slice'
|
|
|
|
|
|
|
|
import type { RagPipelineSliceShape } from '@/app/components/rag-pipeline/store'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export type SliceFromInjection =
|
|
|
|
|
|
|
|
Partial<WorkflowAppSliceShape> &
|
|
|
|
|
|
|
|
Partial<RagPipelineSliceShape>
|
|
|
|
|
|
|
|
|
|
|
|
export type Shape =
|
|
|
|
export type Shape =
|
|
|
|
ChatVariableSliceShape &
|
|
|
|
ChatVariableSliceShape &
|
|
|
|
@ -43,10 +48,12 @@ export type Shape =
|
|
|
|
VersionSliceShape &
|
|
|
|
VersionSliceShape &
|
|
|
|
WorkflowDraftSliceShape &
|
|
|
|
WorkflowDraftSliceShape &
|
|
|
|
WorkflowSliceShape &
|
|
|
|
WorkflowSliceShape &
|
|
|
|
WorkflowAppSliceShape
|
|
|
|
SliceFromInjection
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export type InjectWorkflowStoreSliceFn = StateCreator<SliceFromInjection>
|
|
|
|
|
|
|
|
|
|
|
|
type CreateWorkflowStoreParams = {
|
|
|
|
type CreateWorkflowStoreParams = {
|
|
|
|
injectWorkflowStoreSliceFn?: StateCreator<WorkflowAppSliceShape>
|
|
|
|
injectWorkflowStoreSliceFn?: InjectWorkflowStoreSliceFn
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export const createWorkflowStore = (params: CreateWorkflowStoreParams) => {
|
|
|
|
export const createWorkflowStore = (params: CreateWorkflowStoreParams) => {
|
|
|
|
@ -64,7 +71,7 @@ export const createWorkflowStore = (params: CreateWorkflowStoreParams) => {
|
|
|
|
...createVersionSlice(...args),
|
|
|
|
...createVersionSlice(...args),
|
|
|
|
...createWorkflowDraftSlice(...args),
|
|
|
|
...createWorkflowDraftSlice(...args),
|
|
|
|
...createWorkflowSlice(...args),
|
|
|
|
...createWorkflowSlice(...args),
|
|
|
|
...(injectWorkflowStoreSliceFn?.(...args) || {} as WorkflowAppSliceShape),
|
|
|
|
...(injectWorkflowStoreSliceFn?.(...args) || {} as (SliceFromInjection)),
|
|
|
|
}))
|
|
|
|
}))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|