add MCP tool contracts and authenticated local HTTP transport
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package p.studio.api.automation;
|
||||
|
||||
import p.studio.api.operation.OperationSnapshot;
|
||||
import p.studio.api.shipper.ShipperPrepareResult;
|
||||
import java.util.Objects;
|
||||
|
||||
/** An operation outcome is not task authority. Null result means it is not available yet. */
|
||||
public record TrackedOperation(OperationSnapshot operation, String clientRequestId, Progress progress,
|
||||
String buildId, ShipperPrepareResult buildResult, AutomationOutcome runtimeResult, AutomationFailure failure) {
|
||||
public TrackedOperation {
|
||||
Objects.requireNonNull(operation); Objects.requireNonNull(clientRequestId); Objects.requireNonNull(progress);
|
||||
if (clientRequestId.isBlank()) throw new IllegalArgumentException("Empty client request identity");
|
||||
if (buildResult != null && runtimeResult != null) throw new IllegalArgumentException("Mixed operation result kinds");
|
||||
}
|
||||
/** Unknown progress stays null. Never infer completion from cancellation acknowledgement. */
|
||||
public record Progress(Long requestedFrames, Long completedFrames) {
|
||||
public Progress {
|
||||
if (requestedFrames != null && requestedFrames < 0 || completedFrames != null && completedFrames < 0
|
||||
|| requestedFrames != null && completedFrames != null && completedFrames > requestedFrames)
|
||||
throw new IllegalArgumentException("Invalid frame progress");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user