Spaces:
Running
Running
owenkaplinsky
commited on
Commit
·
4253088
1
Parent(s):
f937d73
Fix output slot issue
Browse files- project/src/index.js +11 -2
project/src/index.js
CHANGED
|
@@ -1037,8 +1037,17 @@ const setupUnifiedStream = () => {
|
|
| 1037 |
// For type: 'input', find the first MCP block and use input_name for the slot
|
| 1038 |
const mcpBlock = ws.getBlocksByType('create_mcp')[0];
|
| 1039 |
if (mcpBlock) {
|
| 1040 |
-
|
| 1041 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1042 |
const input = mcpBlock.getInput(inputSlot);
|
| 1043 |
if (input && input.connection) {
|
| 1044 |
console.log('[SSE CREATE] Placing block into MCP output slot:', inputSlot);
|
|
|
|
| 1037 |
// For type: 'input', find the first MCP block and use input_name for the slot
|
| 1038 |
const mcpBlock = ws.getBlocksByType('create_mcp')[0];
|
| 1039 |
if (mcpBlock) {
|
| 1040 |
+
let inputSlot = data.input_name;
|
| 1041 |
+
|
| 1042 |
+
// If slot name is not in R format, look it up by output name
|
| 1043 |
+
if (inputSlot && !inputSlot.match(/^R\d+$/)) {
|
| 1044 |
+
const outputNames = mcpBlock.outputNames_ || [];
|
| 1045 |
+
const outputIndex = outputNames.indexOf(inputSlot);
|
| 1046 |
+
if (outputIndex >= 0) {
|
| 1047 |
+
inputSlot = 'R' + outputIndex;
|
| 1048 |
+
}
|
| 1049 |
+
}
|
| 1050 |
+
|
| 1051 |
const input = mcpBlock.getInput(inputSlot);
|
| 1052 |
if (input && input.connection) {
|
| 1053 |
console.log('[SSE CREATE] Placing block into MCP output slot:', inputSlot);
|