MCPcopy Index your code
hub / github.com/simstudioai/sim / resolveVariablesLabel

Function resolveVariablesLabel

apps/sim/lib/workflows/subblocks/display.ts:408–427  ·  view source on GitHub ↗
(
  subBlock: SubBlockConfig | undefined,
  rawValue: unknown,
  variables: Array<{ id: string; name: string }>
)

Source from the content-addressed store, hash-verified

406
407/** Resolves a variables-input value to a variable-name summary. */
408export function resolveVariablesLabel(
409 subBlock: SubBlockConfig | undefined,
410 rawValue: unknown,
411 variables: Array<{ id: string; name: string }>
412): string | null {
413 if (subBlock?.type !== 'variables-input') return null
414 if (!isVariableAssignmentsArray(rawValue)) return null
415
416 const names = rawValue
417 .map((assignment) => {
418 if (assignment.variableId) {
419 return variables.find((variable) => variable.id === assignment.variableId)?.name
420 }
421 if (assignment.variableName) return assignment.variableName
422 return null
423 })
424 .filter((name): name is string => !!name)
425
426 return summarizeNames(names)
427}
428
429/**
430 * Resolves a tool-input value to a tool-name summary. Stored tool entries

Callers 3

display.test.tsFile · 0.90
block.tsxFile · 0.90
workflow-block.tsxFile · 0.90

Calls 2

summarizeNamesFunction · 0.85

Tested by

no test coverage detected