Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ export function AiAgentNodeWidget(props: CallNodeWidgetProps) {
documentUri: node.documentUri,
connectorName: stNode.tag.split(".")[0]
});

if (!connectorData) {
console.error(`Connector data not found for connector: ${stNode.tag.split(".")[0]}`);
return;
}

const connectionData: any = await rpcClient.getMiDiagramRpcClient().getConnectorConnections({
documentUri: node.documentUri,
connectorName: stNode.tag.split(".")[0]
Expand Down Expand Up @@ -292,6 +298,12 @@ export function AiAgentNodeWidget(props: CallNodeWidgetProps) {
documentUri: node.documentUri,
connectorName: stNode.tag.split(".")[0]
});

if (!connectorData) {
console.error(`Connector data not found for connector: ${stNode.tag.split(".")[0]}`);
return;
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

const connectionData: any = await rpcClient.getMiDiagramRpcClient().getConnectorConnections({
documentUri: node.documentUri,
connectorName: stNode.tag.split(".")[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export function ConnectorNodeWidget(props: ConnectorNodeWidgetProps) {
}

const connectorIcon = await rpcClient.getMiDiagramRpcClient().getConnectorIcon({
connectorName: node.stNode?.connectorName ?? (node.stNode as any).mediator.connectorName,
connectorName: node.stNode?.connectorName ?? (node.stNode as any).mediator?.connectorName,
documentUri: node.documentUri
});
Comment thread
kaumini marked this conversation as resolved.

Expand All @@ -178,6 +178,11 @@ export function ConnectorNodeWidget(props: ConnectorNodeWidgetProps) {
connectorName: connectorNode.tag.split(".")[0]
});

if (!connectorData) {
console.error(`Connector data not found for connector: ${connectorNode.tag.split(".")[0]}`);
return;
}

const connectionData: any = await rpcClient.getMiDiagramRpcClient().getConnectorConnections({
documentUri: node.documentUri,
connectorName: (node.stNode.tag === 'tool') ?
Expand Down Expand Up @@ -209,6 +214,12 @@ export function ConnectorNodeWidget(props: ConnectorNodeWidgetProps) {
setIsPopoverOpen(false);
}

const hasError = () => {
if (hasDiagnotics) return true;
if (node.stNode.tag === 'tool' && !isMCPTool && !(node.stNode as Tool).mediator) return true;
return false;
}

const getConnectionNodeRange = async () => {
const text = await rpcClient?.getMiDiagramRpcClient().getTextAtRange({
documentUri: node.documentUri,
Expand Down Expand Up @@ -318,7 +329,7 @@ export function ConnectorNodeWidget(props: ConnectorNodeWidgetProps) {
<Tooltip content={!isPopoverOpen && tooltip ? <TooltipEl /> : ""} position={'bottom'} containerPosition={'absolute'}>
<S.Node
selected={node.isSelected()}
hasError={hasDiagnotics}
hasError={hasError()}
hovered={isHovered || isActiveBreakpoint}
isActiveBreakpoint={isActiveBreakpoint}
onMouseEnter={() => setIsHovered(true)}
Expand Down
1 change: 1 addition & 0 deletions workspaces/mi/mi-diagram/src/utils/commons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import { ParamConfig, ParamValueConfig } from "../components/Form/ParamManager/ParamManager";

export const FirstCharToUpperCase = (str: string) => {
if (!str) return str;
return str.charAt(0).toUpperCase() + str.slice(1);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,7 @@ export class NodeFactoryVisitor implements Visitor {
continue;
}
if (toolNode.mediator == undefined) {
this.createNodeAndLinks({ node: toolNode, name: toolNode.tag, type: NodeTypes.CONNECTOR_NODE, dontLink: true });
continue;
}
const isConnector = toolNode.mediator?.connectorName !== undefined;
Expand Down
Loading