MCPcopy Create free account
hub / github.com/ShipSecAI/studio / describePortType

Function describePortType

frontend/src/utils/portUtils.ts:113–137  ·  view source on GitHub ↗
(dataType: PortLike)

Source from the content-addressed store, hash-verified

111};
112
113export const describePortType = (dataType: PortLike): string => {
114 const normalized = normalizePortType(dataType);
115
116 if (normalized.kind === 'any') {
117 return 'any';
118 }
119
120 if (isPrimitive(normalized)) {
121 return primitiveLabelMap[normalized.name ?? 'text'] ?? normalized.name ?? 'text';
122 }
123
124 if (isContract(normalized)) {
125 return normalized.credential ? `credential:${normalized.name}` : `contract:${normalized.name}`;
126 }
127
128 if (isList(normalized)) {
129 return `list<${describePortType(normalized.element)}>`;
130 }
131
132 if (isMap(normalized)) {
133 return `map<${describePortType(normalized.element)}>`;
134 }
135
136 return 'unknown';
137};
138
139export const inputSupportsManualValue = (input: InputPort): boolean => {
140 const normalized = resolvePortType(input);

Callers 2

ConfigPanelFunction · 0.90
validateConnectionFunction · 0.90

Calls 5

normalizePortTypeFunction · 0.85
isPrimitiveFunction · 0.85
isContractFunction · 0.85
isListFunction · 0.85
isMapFunction · 0.85

Tested by

no test coverage detected