import { createContext } from 'react'
import type { NovaKitContextValue, NovaAPI } from '../types'
import { TaskStatus } from '../types'

const defaultApiStub: NovaAPI = {
  apiClient: null,
  getArtifactUrl: async () => ({ data: '' }),
  stopChat: async () => {},
  getConversationInfoList: async () => ({ data: [] }),
}

export const NovaKitContext = createContext<NovaKitContextValue>({
  agentId: '',
  agentName: 'Autonomous Agent',
  messageList: [],
  taskStatus: TaskStatus.PENDING,
  conversationId: null,
  isLoading: false,
  artifacts: [],
  api: defaultApiStub,
  setLoading: () => {},
  loading: false,
})


