Add Run control event stream

This commit is contained in:
npc0-hue
2026-08-26 23:06:06 +08:00
parent 6369a8099a
commit 55a5d6de80
10 changed files with 274 additions and 3 deletions
+28
View File
@@ -2,6 +2,12 @@ package domain
import "time"
const (
RunControlEventTypeReady = "control.ready"
RunControlEventTypeHeartbeat = "control.heartbeat"
RunControlEventTypeJobChanged = "job.changed"
)
type RunCapabilityReport struct {
Capabilities []string
Fingerprint string
@@ -53,6 +59,20 @@ type RunControlHeartbeatResult struct {
ServerTime time.Time
}
type RunControlStreamRequest struct {
RunEndpointID string
SessionToken string
LastEventSeq uint64
}
type RunControlEvent struct {
RunEndpointID string
Sequence uint64
Type string
ServerTime time.Time
RetrySeconds int
}
type RunLifecycleReport struct {
RunEndpointID string
SessionToken string
@@ -126,6 +146,14 @@ func CopyRunControlHeartbeatResult(result RunControlHeartbeatResult) RunControlH
return result
}
func CopyRunControlStreamRequest(request RunControlStreamRequest) RunControlStreamRequest {
return request
}
func CopyRunControlEvent(event RunControlEvent) RunControlEvent {
return event
}
func CopyRunLifecycleReport(report RunLifecycleReport) RunLifecycleReport {
report.ExecutionResult.ServerDeploymentEvidence = CopyServerDeploymentEvidence(report.ExecutionResult.ServerDeploymentEvidence)
report.ExecutionResult.DeploymentReceipt = CopyServerDeploymentExecutionReceipt(report.ExecutionResult.DeploymentReceipt)