feat: add output schema handling and display in NodeConfigPanel; implement buildVariableSpecDisplay function

This commit is contained in:
mlogclub
2026-06-30 11:16:24 +08:00
parent 4ed4108cb9
commit b80a7b9ccb
3 changed files with 53 additions and 0 deletions
@@ -72,6 +72,13 @@ export type WorkflowVariableOption = {
description: string
}
export type WorkflowVariableSpecDisplay = {
key: string
label: string
subtitle: string
description: string
}
export type WorkflowNodeSpec = AIWorkflowNodeSpec
export type WorkflowDraftValidation = {
@@ -110,6 +117,15 @@ export function buildVariableOption(variable: WorkflowVariableRef): WorkflowVari
}
}
export function buildVariableSpecDisplay(variable: WorkflowVariableSpec): WorkflowVariableSpecDisplay {
return {
key: variable.name,
label: variable.label || variable.name,
subtitle: [variable.name, variable.type].filter(Boolean).join(" · "),
description: variable.description || "",
}
}
export function getNodeTitle(
node: AIWorkflowDefinition["nodes"][number] | undefined,
specs: AIWorkflowNodeSpec[] = []