Three parts: (1) all API calls in the frontend, (2) their return values, (3) Pinia store objects that mirror backend data first.
Grouped by service (file).
NamespaceApiService (namespace-api-service.ts)
getAllNamespaces()— namespaceConfig.vue, namespaceSwitch.vuegetNamespaceById(id)— definedcreateNamespace(config)— namespaceConfig.vueupdateNamespace(id, config)— namespaceConfig.vuedeleteNamespace(id)— namespaceConfig.vue
MemoryApiService (memory-api-service.ts)
getMemories()— Memory.vuegetMemory(conversationId)— definedcreateMemory(conversationId, memoryName)— definedupdateMemory(conversationId, memoryName)— Memory.vuedeleteMemory(conversationId)— Memory.vuegenerateConversationId()— definedgetConversationHistory(conversationId)— useConversationHistory.ts
PlanTemplateApiService (plan-template-service.ts)
createOrUpdatePlanTemplateWithTool(data)— planTemplateConfig store, JsonEditorV2getPlanTemplateConfigVO(planTemplateId)— planTemplateConfig storegetAllPlanTemplateConfigVOs()— templateStore, TemplateList, planTemplateConfig store, JsonEditorV2deletePlanTemplate(planTemplateId)— templateStoreexportAllPlanTemplates()— planTemplateConfig.vue (or equivalent)importPlanTemplates(templates)— usePlanTemplateImportgeneratePlanTemplateId()— templateStore, JsonEditorV2getParameterRequirements(planTemplateId)— ExecutionController, PublishServiceModal
DirectApiService (lynxe-service.ts, mirrors LynxeController /api/executor)
sendMessage(query)— legacysendChatMessage(query, requestSource, onChunk, abortSignal)— useMessageDialogexecuteByToolName(...)— useMessageDialog (dialog tool run + plan execution flow)getTaskStatus(planId)— useTaskStopstopTask(planId)— useTaskStopcancelChatStream(conversationId, streamId)— useMessageDialoggetDetails(planId)— usePlanExecutiondeleteExecutionDetails(planId)— usePlanExecutionsubmitFormInput(planId, formData)— UserInputForm.vuegetAllPrompts()— definedgetAgentExecutionDetail(stepId)— useRightPanelrefreshAgentExecutionDetail(stepId)— useRightPanel
ToolApiService (tool-api-service.ts)
getAvailableTools()— availableTools store, JsonEditorV2
ConfigApiService (config-api-service.ts)
getAvailableModels()— JsonEditorV2getVersion()— basicConfig.vue
ModelApiService (model-api-service.ts)
getAllModels(),getAllTypes()— modelConfig.vuegetModelById(id)— modelConfig.vuevalidateConfig(request)— modelConfig.vuecreateModel(config)— modelConfig.vueupdateModel(id, config)— modelConfig.vuedeleteModel(id)— modelConfig.vuesetDefaultModel(id)— modelConfig.vue
AdminApiService (admin-api-service.ts)
getConfigsByGroup(groupName)— basicConfig.vuebatchUpdateConfigs(configs)— basicConfig.vuegetConfigById(id)— definedupdateConfig(config)— definedresetAllConfigsToDefaults()— basicConfig.vue
McpApiService (mcp-api-service.ts)
getAllMcpServers()— mcpConfig.vueaddMcpServer(config)— definedimportMcpServers(jsonData)— mcpConfig.vueremoveMcpServer(id)— mcpConfig.vuesaveMcpServer(request)— mcpConfig.vuegetMcpServer(id)— definedenableMcpServer(id)— defineddisableMcpServer(id)— defined
DatasourceConfigApiService (datasource-config-api-service.ts)
getAllConfigs()— databaseConfig.vuegetConfigById(id)— databaseConfig.vuecreateConfig(config)— databaseConfig.vueupdateConfig(id, config)— databaseConfig.vuedeleteConfig(id)— databaseConfig.vuetestConnection(config)— DatasourceConfigForm.vue
FileBrowserApiService (file-browser-api-service.ts)
getFileTree(planId)— file-browser/index.vuegetFileContent(planId, path)— file-browser/index.vuedownloadFile(planId, path, name)— file-browser/index.vue
FileUploadApiService (file-upload-api-service.ts)
uploadFiles(files)— FileUploadComponent.vuegetUploadedFiles(uploadKey)— defineddeleteFile(uploadKey, fileName)— FileUploadComponent.vuegetUploadConfig()— defined
CronApiService (cron-api-service.ts)
getAllCronTasks()— CronTaskModal.vuegetCronTaskById(id)— definedcreateCronTask(config)— cron-task-utilsupdateCronTask(id, config)— cron-task-utilsdeleteCronTask(id)— cron-task-utils
DatabaseCleanupApiService (database-cleanup-api-service.ts)
getTableCounts()— databaseCleanupConfig.vueclearAllTables()— databaseCleanupConfig.vue
Init (fetch)
POST /api/init/save— init/index.vueGET /api/init/status— init/index.vue, router, llm-check
Language (language.ts)
getLanguage()— api/language.tssetLanguage(language)— api/language.ts
NamespaceApiService
getAllNamespaces()→Namespace[]—{ id, code, name, description?, host? }getNamespaceById(id)→NamespacecreateNamespace(config)→NamespaceupdateNamespace(id, config)→NamespacedeleteNamespace(id)→void
MemoryApiService
getMemories()→Memory[]— fromMemoryResponse.memories; shape{ id, conversation_id, memory_name, create_time, messages? }getMemory(conversationId)→Memory(fromMemoryResponse.data)createMemory(...)→MemoryupdateMemory(...)→MemorydeleteMemory(...)→voidgenerateConversationId()→MemorygetConversationHistory(conversationId)→PlanExecutionRecord[]
PlanTemplateApiService
createOrUpdatePlanTemplateWithTool(data)→CreateOrUpdatePlanTemplateWithToolResponse—{ success, planTemplateId, toolRegistered }getPlanTemplateConfigVO(planTemplateId)→PlanTemplateConfigVOgetAllPlanTemplateConfigVOs()→PlanTemplateConfigVO[]deletePlanTemplate(planTemplateId)→unknownexportAllPlanTemplates()→PlanTemplateConfigVO[]importPlanTemplates(templates)→{ success, total, successCount, failureCount, errors: { planTemplateId, message }[] }generatePlanTemplateId()→string(planTemplateId)getParameterRequirements(planTemplateId)→ParameterRequirements—{ parameters, hasParameters, requirements }
DirectApiService (lynxe-service.ts)
sendMessage(query)→unknownsendChatMessage(...)→Promise<{ conversationId?, message? }>plus SSE chunksexecuteByToolName(...)→unknown— typically{ planId?, conversationId? }getTaskStatus(planId)→{ planId, isRunning, exists, desiredState?, startTime?, endTime?, lastUpdated?, taskResult? }stopTask(planId)→unknowncancelChatStream(...)→{ status, message }getDetails(planId)→PlanExecutionRecordResponse | nulldeleteExecutionDetails(planId)→Record<string, string>submitFormInput(planId, formData)→Record<string, unknown>or{ success: true }getAllPrompts()→unknown[]getAgentExecutionDetail(stepId)→AgentExecutionRecordDetail | nullrefreshAgentExecutionDetail(stepId)→AgentExecutionRecordDetail | null
ToolApiService
getAvailableTools()→Tool[]—{ key, name, description, enabled, serviceGroup, selectable }
ConfigApiService
getAvailableModels()→AvailableModelsResponse—{ options: ModelOption[], total },ModelOption={ value, label }getVersion()→{ version, buildTime, timestamp }
ModelApiService
getAllModels()→Model[]getAllTypes()→string[]getModelById(id)→ModelvalidateConfig(request)→ValidationResult—{ valid, message?, availableModels? }createModel(config)→ModelupdateModel(id, config)→ModeldeleteModel(id)→voidsetDefaultModel(id)→{ success, message }
AdminApiService
getConfigsByGroup(groupName)→ConfigItem[]batchUpdateConfigs(configs)→ApiResponse—{ success, message }getConfigById(id)→ConfigItemupdateConfig(config)→ApiResponseresetAllConfigsToDefaults()→ApiResponse
McpApiService
getAllMcpServers()→McpServer[]addMcpServer(config)→ApiResponseimportMcpServers(jsonData)→ApiResponseremoveMcpServer(id)→ApiResponsesaveMcpServer(request)→ApiResponsegetMcpServer(id)→ serverenableMcpServer(id)→ApiResponsedisableMcpServer(id)→ApiResponse
DatasourceConfigApiService
getAllConfigs()→DatasourceConfig[]getConfigById(id)→DatasourceConfigcreateConfig(config)→DatasourceConfigupdateConfig(id, config)→DatasourceConfigdeleteConfig(id)→voidtestConnection(config)→{ success, message }
FileBrowserApiService
getFileTree(planId)→FileNode—{ name, path, type, size, lastModified, children? }getFileContent(planId, path)→FileContent—{ content, mimeType, size, isBinary?, downloadOnly? }
FileUploadApiService
uploadFiles(files)→FileUploadResult—{ success, message, uploadKey, uploadedFiles, totalFiles, successfulFiles, failedFiles }getUploadedFiles(uploadKey)→GetUploadedFilesResponsedeleteFile(...)→DeleteFileResponsegetUploadConfig()→UploadConfig
CronApiService
getAllCronTasks()→CronConfig[]getCronTaskById(id)→CronConfigcreateCronTask(config)→CronConfigupdateCronTask(id, config)→CronConfigdeleteCronTask(id)→void
DatabaseCleanupApiService
getTableCounts()→TableCounts—{ act_tool_info, think_act_record, plan_execution_record, agent_execution_record, ai_chat_memory }clearAllTables()→TableCounts
Init
POST /api/init/save→{ success, requiresRestart?, error? }GET /api/init/status→{ success, initialized }
Language
getLanguage()→'zh' | 'en'(fromLanguageResponse.language)setLanguage(language)→SetLanguageResponse—{ success, language, error? }
Design rule: each store holds data that comes from (or is sent to) the backend; UI-only state (collapsed, active tab, etc.) lives in components or a separate UI store.
Suggested stores and their backend-mirror state:
A. namespace (align with API)
- Backend mirror:
namespaces: Ref<Namespace[]>fromNamespaceApiService.getAllNamespaces();currentNamespaceId: Ref<string>(e.g.'default'). - Actions:
setNamespaces(list),setCurrentNamespace(id), optionalloadNamespaces(). - Persistence: optional
currentNamespaceIdin localStorage.
B. conversation (memory backend data only)
- Backend mirror:
conversations: Ref<Memory[]>fromMemoryApiService.getMemories();selectedConversationId: Ref<string | null>. - Actions:
setConversations(list),setSelectedConversationId(id),loadConversations(), optionalloadConversationHistory(conversationId). - Persistence:
selectedConversationIdin localStorage. - Do not put here:
isCollapsed,loadMessagescallback,intervalId— keep in Memory panel or a smallmemoryPanelUI store.
C. planTemplate (plan template list + current config from backend)
- Backend mirror:
planTemplateList: Ref<PlanTemplateConfigVO[]>fromgetAllPlanTemplateConfigVOs();currentConfig: Ref<PlanTemplateConfigVO | null>fromgetPlanTemplateConfigVO(id);currentPlanTemplateId: Ref<string | null>;planVersions: Ref<string[]>;currentVersionIndex: Ref<number>. - Actions:
loadPlanTemplateList(),loadPlanTemplateConfig(id),savePlanTemplateConfig(),createNewTemplate(planType),deletePlanTemplate(id),setCurrentPlanTemplateId(id),loadPlanVersions(planId),setCurrentVersionIndex(i). - Persistence: none; backend is source of truth.
- Optional: after
importPlanTemplates, write intoplanTemplateList(and maybeimportResult).
D. planExecution (execution records from backend)
- Backend mirror:
recordsByPlanId: Ref<Record<string, PlanExecutionRecord>>fromDirectApiService.getDetails(planId)(polling);trackedPlanIds: Ref<Set<string>>. - Actions:
trackPlan(planId),untrackPlan(planId),fetchDetails(planId),setCachedPlanRecord(planId, record),deleteExecutionDetails(planId). - Persistence: none; cache only.
E. availableTools (tools from backend)
- Backend mirror:
tools: Ref<Tool[]>fromToolApiService.getAvailableTools()—{ key, name, description, enabled, serviceGroup, selectable }. - Actions:
setTools(list),loadTools(). - Persistence: none.
- Optional getter:
selectableTools(filterselectable !== false).
F. parameterRequirements (optional; backend-only cache)
- Backend mirror:
requirementsByPlanTemplateId: Ref<Record<string, ParameterRequirements>>fromPlanTemplateApiService.getParameterRequirements(planTemplateId). - Actions:
getOrLoadRequirements(planTemplateId). - Persistence: none.
- Note: parameter history (user’s past parameter sets) is frontend-only; keep in a separate store (e.g.
parameterHistory).
G. Config / admin (optional single store or split)
- Models:
models: Ref<Model[]>,modelTypes: Ref<string[]>,defaultModelId: Ref<string | null>— from ModelApiService. - Admin config:
configByGroup: Ref<Record<string, ConfigItem[]>>fromAdminApiService.getConfigsByGroup(groupName). - Actions:
loadModels(),loadModelTypes(),loadConfigGroup(groupName),updateConfig(config),batchUpdateConfigs(configs),resetAllConfigsToDefaults(). - Persistence: none.
- Can split into
modelConfigandadminConfig.
H. mcpServers (backend mirror)
- Backend mirror:
servers: Ref<McpServer[]>fromMcpApiService.getAllMcpServers(). - Actions:
setServers(list),loadServers(), thin wrappers after add/remove/enable/disable. - Persistence: none.
I. datasourceConfigs (backend mirror)
- Backend mirror:
configs: Ref<DatasourceConfig[]>fromDatasourceConfigApiService.getAllConfigs(). - Actions:
setConfigs(list),loadConfigs(), reload/update after create/update/delete. - Persistence: none.
J. cronTasks (backend mirror)
- Backend mirror:
cronTasks: Ref<CronConfig[]>fromCronApiService.getAllCronTasks(). - Actions:
setCronTasks(list),loadCronTasks(), reload/update after create/update/delete. - Persistence: none.
K. app / runtime (backend-related, not list backend)
- Version:
version: Ref<{ version, buildTime, timestamp } | null>fromConfigApiService.getVersion(). - Init:
initStatus: Ref<{ success, initialized } | null>fromGET /api/init/status. - Task:
currentTaskPlanId: Ref<string | null>; optionaltaskStatusByPlanId: Ref<Record<string, TaskStatus>>fromDirectApiService.getTaskStatus(planId). - Actions:
loadVersion(),checkInitStatus(),setCurrentTaskPlanId(id), optionalfetchTaskStatus(planId). - Persistence: optional “has visited home” / init flags in localStorage.
- namespace — namespaces, currentNamespaceId — NamespaceApiService
- conversation — conversations (Memory[]), selectedConversationId — MemoryApiService
- planTemplate — planTemplateList, currentConfig, currentPlanTemplateId, planVersions, currentVersionIndex — PlanTemplateApiService
- planExecution — recordsByPlanId, trackedPlanIds — DirectApiService.getDetails
- availableTools — tools (Tool[]) — ToolApiService
- parameterRequirements (optional) — requirementsByPlanTemplateId — PlanTemplateApiService.getParameterRequirements
- parameterHistory — frontend-only (past param sets)
- modelConfig (optional) — models, modelTypes — ModelApiService
- adminConfig (optional) — configByGroup — AdminApiService
- mcpServers — servers (McpServer[]) — McpApiService
- datasourceConfigs — configs (DatasourceConfig[]) — DatasourceConfigApiService
- cronTasks — cronTasks (CronConfig[]) — CronApiService
- app (or runtime) — version, initStatus, currentTaskPlanId — ConfigApiService.getVersion, init, DirectApiService.getTaskStatus
Implement these first as Pinia stores that only hold and load/save the above backend-mirror data. Then add UI state (e.g. sidebar collapsed, right-panel tab) in components or a small ui / memoryPanel store so that “objects that mirror the backend” stay clear and separate from UI.