{
  "name": "Built-in Blocks",
  "description": "Core workflow blocks for BRIKA automations",
  "blocks": {
    "clock": {
      "name": "Clock",
      "description": "Emit periodic ticks at a configurable interval",
      "ports": {
        "tick": {
          "name": "Tick",
          "description": "Emitted on each interval with count and timestamp"
        }
      }
    },
    "http-request": {
      "name": "HTTP Request",
      "description": "Make HTTP requests to external APIs",
      "ports": {
        "trigger": {
          "name": "Trigger",
          "description": "Trigger the HTTP request"
        },
        "response": {
          "name": "Response",
          "description": "HTTP response with status, headers, and body"
        },
        "error": {
          "name": "Error",
          "description": "Error details if request fails"
        }
      }
    },
    "condition": {
      "name": "Condition",
      "description": "Branch based on a condition",
      "ports": {
        "in": {
          "name": "Input",
          "description": "Value to check"
        },
        "then": {
          "name": "Then",
          "description": "Output when condition is true"
        },
        "else": {
          "name": "Else",
          "description": "Output when condition is false"
        }
      }
    },
    "switch": {
      "name": "Switch",
      "description": "Multi-way branch based on value",
      "ports": {
        "in": {
          "name": "Input",
          "description": "Value to check"
        },
        "case1": {
          "name": "Case 1",
          "description": "First case output"
        },
        "case2": {
          "name": "Case 2",
          "description": "Second case output"
        },
        "case3": {
          "name": "Case 3",
          "description": "Third case output"
        },
        "default": {
          "name": "Default",
          "description": "Output when no case matches"
        }
      }
    },
    "delay": {
      "name": "Delay",
      "description": "Wait for a specified duration",
      "ports": {
        "in": {
          "name": "Input",
          "description": "Data to delay"
        },
        "out": {
          "name": "Output",
          "description": "Delayed data"
        }
      }
    },
    "transform": {
      "name": "Transform",
      "description": "Transform or extract data",
      "ports": {
        "in": {
          "name": "Input",
          "description": "Data to transform"
        },
        "out": {
          "name": "Output",
          "description": "Transformed data"
        }
      }
    },
    "log": {
      "name": "Log",
      "description": "Log a message",
      "ports": {
        "in": {
          "name": "Input",
          "description": "Data to log"
        },
        "out": {
          "name": "Output",
          "description": "Passthrough data"
        }
      }
    },
    "merge": {
      "name": "Merge",
      "description": "Wait for and merge multiple inputs",
      "ports": {
        "a": {
          "name": "Input A",
          "description": "First input"
        },
        "b": {
          "name": "Input B",
          "description": "Second input"
        },
        "out": {
          "name": "Output",
          "description": "Combined inputs"
        }
      }
    },
    "split": {
      "name": "Split",
      "description": "Split execution to parallel branches",
      "ports": {
        "in": {
          "name": "Input",
          "description": "Data to split"
        },
        "a": {
          "name": "Branch A",
          "description": "First branch"
        },
        "b": {
          "name": "Branch B",
          "description": "Second branch"
        }
      }
    },
    "end": {
      "name": "End",
      "description": "Terminate the workflow",
      "ports": {
        "in": {
          "name": "Input",
          "description": "Final data"
        }
      }
    },
    "spark-receiver": {
      "name": "Spark Receiver",
      "description": "Receives typed spark events from plugins",
      "ports": {
        "out": {
          "name": "Payload",
          "description": "The spark event payload"
        }
      }
    }
  },
  "fields": {
    "field": {
      "label": "Field",
      "description": "Field path to check (e.g., \"value\", \"data.status\")"
    },
    "operator": {
      "label": "Operator",
      "description": "Comparison operator"
    },
    "value": {
      "label": "Value",
      "description": "Value to compare against"
    },
    "case1": {
      "label": "Case 1",
      "description": "Value for case 1"
    },
    "case2": {
      "label": "Case 2",
      "description": "Value for case 2"
    },
    "case3": {
      "label": "Case 3",
      "description": "Value for case 3"
    },
    "duration": {
      "label": "Duration",
      "description": "How long to wait"
    },
    "message": {
      "label": "Message",
      "description": "Message template with {{inputs.in.field}} expressions"
    },
    "level": {
      "label": "Log Level",
      "description": "Severity level for the log entry"
    },
    "status": {
      "label": "Status",
      "description": "End status of the workflow"
    },
    "template": {
      "label": "Template",
      "description": "Template to build output object"
    },
    "interval": {
      "label": "Interval",
      "description": "Time between ticks"
    },
    "emitOnStart": {
      "label": "Emit on Start",
      "description": "Emit an initial tick immediately when started"
    },
    "url": {
      "label": "URL",
      "description": "Request URL"
    },
    "method": {
      "label": "Method",
      "description": "HTTP method (GET, POST, etc.)"
    },
    "headers": {
      "label": "Headers",
      "description": "HTTP request headers"
    },
    "body": {
      "label": "Body",
      "description": "Request body (for POST/PUT/PATCH)"
    },
    "timeout": {
      "label": "Timeout",
      "description": "Request timeout"
    },
    "sparkType": {
      "label": "Spark Type",
      "description": "The spark type to listen for (e.g., timer:tick)"
    }
  }
}
