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.

796 B
Raw Blame
import type {
  ParametersSchema,
  PluginDeclaration,
  PluginDetail,
  PluginTriggerSubscriptionConstructor,
} from '../types'
import { create } from 'zustand'

type TriggerDeclarationSummary = {
  subscription_schema?: ParametersSchema[]
  subscription_constructor?: PluginTriggerSubscriptionConstructor | null
}

export type SimpleDetail = Pick<
  PluginDetail,
  'plugin_id' | 'name' | 'plugin_unique_identifier' | 'id'
> & {
  provider: string
  declaration: Partial<Omit<PluginDeclaration, 'trigger'>> & {
    trigger?: TriggerDeclarationSummary
  }
}

type Shape = {
  detail: SimpleDetail | undefined
  setDetail: (detail?: SimpleDetail) => void
}

export const usePluginStore = create<Shape>((set) => ({
  detail: undefined,
  setDetail: (detail?: SimpleDetail) => set({ detail }),
}))