#pragma once #include "CoreMinimal.h" #include "WingServer.h" #include "WingBasics.h" #include "Sequence.generated.h" // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- UCLASS() class UWing_Sequence : public UWingHandler { GENERATED_BODY() public: UPROPERTY(EditAnywhere, meta=(Description= "Array of subcommand JSON objects to execute in order. Each must contain 'command' and its parameters.")) FWingJsonArray Subcommands; virtual void Register() override { UWingServer::AddHandler(this, TEXT("Execute multiple commands in one request. Each subcommand " "produces its own content block in the response. The big win " "performance-wise is that fewer MCP calls means fewer " "round-trip invocations of the LLM.")); } virtual void Handle() override { // The actual code that implements Sequence is hardwired into // WingServer. Because of that, this handler is never actually called // under normal conditions. The handler exists for two reasons: to // provide documentation, and also to catch the case where somebody // nests a sequence inside another sequence. WingOut::Stdout.Print( TEXT("ERROR: Sequence inside a Sequence is not allowed.\n")); } };