diff --git a/.changeset/purple-needles-juggle.md b/.changeset/purple-needles-juggle.md new file mode 100644 index 000000000..829f5a9b8 --- /dev/null +++ b/.changeset/purple-needles-juggle.md @@ -0,0 +1,5 @@ +--- +"@livekit/protocol": patch +--- + +rename agent environment to deployment diff --git a/agent/environment.go b/agent/environment.go index 4c1a5ff16..24acbb323 100644 --- a/agent/environment.go +++ b/agent/environment.go @@ -2,22 +2,22 @@ package agent import "fmt" -const MaxEnvironmentLength = 64 +const MaxDeploymentLength = 64 -func ValidateEnvironment(env string) error { - if env == "" { +func ValidateDeployment(deployment string) error { + if deployment == "" { return nil } - if len(env) > MaxEnvironmentLength { - return fmt.Errorf("environment exceeds %d bytes", MaxEnvironmentLength) + if len(deployment) > MaxDeploymentLength { + return fmt.Errorf("deployment exceeds %d bytes", MaxDeploymentLength) } - for i := 0; i < len(env); i++ { - c := env[i] + for i := 0; i < len(deployment); i++ { + c := deployment[i] switch { case c == '_': - return fmt.Errorf("environment contains reserved character %q", c) + return fmt.Errorf("deployment contains reserved character %q", c) case c <= ' ' || c == 0x7f: - return fmt.Errorf("environment contains whitespace or control byte at position %d", i) + return fmt.Errorf("deployment contains whitespace or control byte at position %d", i) } } return nil diff --git a/livekit/livekit_agent.pb.go b/livekit/livekit_agent.pb.go index 1725a6ccf..1217609af 100644 --- a/livekit/livekit_agent.pb.go +++ b/livekit/livekit_agent.pb.go @@ -196,7 +196,7 @@ type Job struct { AgentName string `protobuf:"bytes,7,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` State *JobState `protobuf:"bytes,8,opt,name=state,proto3" json:"state,omitempty"` EnableRecording bool `protobuf:"varint,10,opt,name=enable_recording,json=enableRecording,proto3" json:"enable_recording,omitempty"` - Environment string `protobuf:"bytes,11,opt,name=environment,proto3" json:"environment,omitempty"` + Deployment string `protobuf:"bytes,11,opt,name=deployment,proto3" json:"deployment,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -302,9 +302,9 @@ func (x *Job) GetEnableRecording() bool { return false } -func (x *Job) GetEnvironment() string { +func (x *Job) GetDeployment() string { if x != nil { - return x.Environment + return x.Deployment } return "" } @@ -875,7 +875,7 @@ type RegisterWorkerRequest struct { PingInterval uint32 `protobuf:"varint,5,opt,name=ping_interval,json=pingInterval,proto3" json:"ping_interval,omitempty"` Namespace *string `protobuf:"bytes,6,opt,name=namespace,proto3,oneof" json:"namespace,omitempty"` AllowedPermissions *ParticipantPermission `protobuf:"bytes,7,opt,name=allowed_permissions,json=allowedPermissions,proto3" json:"allowed_permissions,omitempty"` - Environment string `protobuf:"bytes,9,opt,name=environment,proto3" json:"environment,omitempty"` + Deployment string `protobuf:"bytes,9,opt,name=deployment,proto3" json:"deployment,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -952,9 +952,9 @@ func (x *RegisterWorkerRequest) GetAllowedPermissions() *ParticipantPermission { return nil } -func (x *RegisterWorkerRequest) GetEnvironment() string { +func (x *RegisterWorkerRequest) GetDeployment() string { if x != nil { - return x.Environment + return x.Deployment } return "" } @@ -1441,7 +1441,7 @@ var File_livekit_agent_proto protoreflect.FileDescriptor const file_livekit_agent_proto_rawDesc = "" + "\n" + - "\x13livekit_agent.proto\x12\alivekit\x1a\x14livekit_models.proto\x1a\x14logger/options.proto\"\xb2\x03\n" + + "\x13livekit_agent.proto\x12\alivekit\x1a\x14livekit_models.proto\x1a\x14logger/options.proto\"\xb0\x03\n" + "\x03Job\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12.\n" + "\vdispatch_id\x18\t \x01(\tB\r\xbaP\n" + @@ -1456,8 +1456,10 @@ const file_livekit_agent_proto_rawDesc = "" + "agent_name\x18\a \x01(\tR\tagentName\x12'\n" + "\x05state\x18\b \x01(\v2\x11.livekit.JobStateR\x05state\x12)\n" + "\x10enable_recording\x18\n" + - " \x01(\bR\x0fenableRecording\x12 \n" + - "\venvironment\x18\v \x01(\tR\venvironmentB\x0e\n" + + " \x01(\bR\x0fenableRecording\x12\x1e\n" + + "\n" + + "deployment\x18\v \x01(\tR\n" + + "deploymentB\x0e\n" + "\f_participant\"\xa9\x02\n" + "\bJobState\x12*\n" + "\x06status\x18\x01 \x01(\x0e2\x12.livekit.JobStatusR\x06status\x12\x14\n" + @@ -1501,7 +1503,7 @@ const file_livekit_agent_proto_rawDesc = "" + "\n" + "WorkerPong\x12%\n" + "\x0elast_timestamp\x18\x01 \x01(\x03R\rlastTimestamp\x12\x1c\n" + - "\ttimestamp\x18\x02 \x01(\x03R\ttimestamp\"\xbf\x02\n" + + "\ttimestamp\x18\x02 \x01(\x03R\ttimestamp\"\xbd\x02\n" + "\x15RegisterWorkerRequest\x12$\n" + "\x04type\x18\x01 \x01(\x0e2\x10.livekit.JobTypeR\x04type\x12\x1d\n" + "\n" + @@ -1509,8 +1511,10 @@ const file_livekit_agent_proto_rawDesc = "" + "\aversion\x18\x03 \x01(\tR\aversion\x12#\n" + "\rping_interval\x18\x05 \x01(\rR\fpingInterval\x12!\n" + "\tnamespace\x18\x06 \x01(\tH\x00R\tnamespace\x88\x01\x01\x12O\n" + - "\x13allowed_permissions\x18\a \x01(\v2\x1e.livekit.ParticipantPermissionR\x12allowedPermissions\x12 \n" + - "\venvironment\x18\t \x01(\tR\venvironmentB\f\n" + + "\x13allowed_permissions\x18\a \x01(\v2\x1e.livekit.ParticipantPermissionR\x12allowedPermissions\x12\x1e\n" + + "\n" + + "deployment\x18\t \x01(\tR\n" + + "deploymentB\f\n" + "\n" + "_namespace\"x\n" + "\x16RegisterWorkerResponse\x12(\n" + diff --git a/livekit/livekit_agent_dispatch.pb.go b/livekit/livekit_agent_dispatch.pb.go index 9afaf6d67..b7a4bc7fb 100644 --- a/livekit/livekit_agent_dispatch.pb.go +++ b/livekit/livekit_agent_dispatch.pb.go @@ -88,7 +88,7 @@ type CreateAgentDispatchRequest struct { Room string `protobuf:"bytes,2,opt,name=room,proto3" json:"room,omitempty"` Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` RestartPolicy JobRestartPolicy `protobuf:"varint,4,opt,name=restart_policy,json=restartPolicy,proto3,enum=livekit.JobRestartPolicy" json:"restart_policy,omitempty"` // cloud only - Environment string `protobuf:"bytes,5,opt,name=environment,proto3" json:"environment,omitempty"` + Deployment string `protobuf:"bytes,5,opt,name=deployment,proto3" json:"deployment,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -151,9 +151,9 @@ func (x *CreateAgentDispatchRequest) GetRestartPolicy() JobRestartPolicy { return JobRestartPolicy_JRP_ON_FAILURE } -func (x *CreateAgentDispatchRequest) GetEnvironment() string { +func (x *CreateAgentDispatchRequest) GetDeployment() string { if x != nil { - return x.Environment + return x.Deployment } return "" } @@ -163,7 +163,7 @@ type RoomAgentDispatch struct { AgentName string `protobuf:"bytes,1,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` Metadata string `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` RestartPolicy JobRestartPolicy `protobuf:"varint,3,opt,name=restart_policy,json=restartPolicy,proto3,enum=livekit.JobRestartPolicy" json:"restart_policy,omitempty"` // cloud only - Environment string `protobuf:"bytes,4,opt,name=environment,proto3" json:"environment,omitempty"` + Deployment string `protobuf:"bytes,4,opt,name=deployment,proto3" json:"deployment,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -219,9 +219,9 @@ func (x *RoomAgentDispatch) GetRestartPolicy() JobRestartPolicy { return JobRestartPolicy_JRP_ON_FAILURE } -func (x *RoomAgentDispatch) GetEnvironment() string { +func (x *RoomAgentDispatch) GetDeployment() string { if x != nil { - return x.Environment + return x.Deployment } return "" } @@ -382,7 +382,7 @@ type AgentDispatch struct { Metadata string `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` State *AgentDispatchState `protobuf:"bytes,5,opt,name=state,proto3" json:"state,omitempty"` RestartPolicy JobRestartPolicy `protobuf:"varint,6,opt,name=restart_policy,json=restartPolicy,proto3,enum=livekit.JobRestartPolicy" json:"restart_policy,omitempty"` // cloud only - Environment string `protobuf:"bytes,7,opt,name=environment,proto3" json:"environment,omitempty"` + Deployment string `protobuf:"bytes,7,opt,name=deployment,proto3" json:"deployment,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -459,9 +459,9 @@ func (x *AgentDispatch) GetRestartPolicy() JobRestartPolicy { return JobRestartPolicy_JRP_ON_FAILURE } -func (x *AgentDispatch) GetEnvironment() string { +func (x *AgentDispatch) GetDeployment() string { if x != nil { - return x.Environment + return x.Deployment } return "" } @@ -532,20 +532,24 @@ var File_livekit_agent_dispatch_proto protoreflect.FileDescriptor const file_livekit_agent_dispatch_proto_rawDesc = "" + "\n" + - "\x1clivekit_agent_dispatch.proto\x12\alivekit\x1a\x13livekit_agent.proto\x1a\x14logger/options.proto\"\xd4\x01\n" + + "\x1clivekit_agent_dispatch.proto\x12\alivekit\x1a\x13livekit_agent.proto\x1a\x14logger/options.proto\"\xd2\x01\n" + "\x1aCreateAgentDispatchRequest\x12\x1d\n" + "\n" + "agent_name\x18\x01 \x01(\tR\tagentName\x12\x12\n" + "\x04room\x18\x02 \x01(\tR\x04room\x12\x1f\n" + "\bmetadata\x18\x03 \x01(\tB\x03\xa8P\x01R\bmetadata\x12@\n" + - "\x0erestart_policy\x18\x04 \x01(\x0e2\x19.livekit.JobRestartPolicyR\rrestartPolicy\x12 \n" + - "\venvironment\x18\x05 \x01(\tR\venvironment\"\xb7\x01\n" + + "\x0erestart_policy\x18\x04 \x01(\x0e2\x19.livekit.JobRestartPolicyR\rrestartPolicy\x12\x1e\n" + + "\n" + + "deployment\x18\x05 \x01(\tR\n" + + "deployment\"\xb5\x01\n" + "\x11RoomAgentDispatch\x12\x1d\n" + "\n" + "agent_name\x18\x01 \x01(\tR\tagentName\x12\x1f\n" + "\bmetadata\x18\x02 \x01(\tB\x03\xa8P\x01R\bmetadata\x12@\n" + - "\x0erestart_policy\x18\x03 \x01(\x0e2\x19.livekit.JobRestartPolicyR\rrestartPolicy\x12 \n" + - "\venvironment\x18\x04 \x01(\tR\venvironment\"`\n" + + "\x0erestart_policy\x18\x03 \x01(\x0e2\x19.livekit.JobRestartPolicyR\rrestartPolicy\x12\x1e\n" + + "\n" + + "deployment\x18\x04 \x01(\tR\n" + + "deployment\"`\n" + "\x1aDeleteAgentDispatchRequest\x12.\n" + "\vdispatch_id\x18\x01 \x01(\tB\r\xbaP\n" + "dispatchIDR\n" + @@ -557,7 +561,7 @@ const file_livekit_agent_dispatch_proto_rawDesc = "" + "dispatchId\x12\x12\n" + "\x04room\x18\x02 \x01(\tR\x04room\"^\n" + "\x19ListAgentDispatchResponse\x12A\n" + - "\x10agent_dispatches\x18\x01 \x03(\v2\x16.livekit.AgentDispatchR\x0fagentDispatches\"\x8a\x02\n" + + "\x10agent_dispatches\x18\x01 \x03(\v2\x16.livekit.AgentDispatchR\x0fagentDispatches\"\x88\x02\n" + "\rAgentDispatch\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1d\n" + "\n" + @@ -565,8 +569,10 @@ const file_livekit_agent_dispatch_proto_rawDesc = "" + "\x04room\x18\x03 \x01(\tR\x04room\x12\x1f\n" + "\bmetadata\x18\x04 \x01(\tB\x03\xa8P\x01R\bmetadata\x121\n" + "\x05state\x18\x05 \x01(\v2\x1b.livekit.AgentDispatchStateR\x05state\x12@\n" + - "\x0erestart_policy\x18\x06 \x01(\x0e2\x19.livekit.JobRestartPolicyR\rrestartPolicy\x12 \n" + - "\venvironment\x18\a \x01(\tR\venvironment\"t\n" + + "\x0erestart_policy\x18\x06 \x01(\x0e2\x19.livekit.JobRestartPolicyR\rrestartPolicy\x12\x1e\n" + + "\n" + + "deployment\x18\a \x01(\tR\n" + + "deployment\"t\n" + "\x12AgentDispatchState\x12 \n" + "\x04jobs\x18\x01 \x03(\v2\f.livekit.JobR\x04jobs\x12\x1d\n" + "\n" + diff --git a/livekit/livekit_agent_dispatch.twirp.go b/livekit/livekit_agent_dispatch.twirp.go index c0831900d..eff396030 100644 --- a/livekit/livekit_agent_dispatch.twirp.go +++ b/livekit/livekit_agent_dispatch.twirp.go @@ -1076,41 +1076,41 @@ func (s *agentDispatchServiceServer) PathPrefix() string { var twirpFileDescriptor1 = []byte{ // 582 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0xc1, 0x6e, 0xd3, 0x4c, - 0x10, 0xfe, 0x6d, 0xa7, 0xed, 0x9f, 0x49, 0x63, 0xc2, 0x52, 0x21, 0xd7, 0x80, 0x08, 0xe9, 0xa5, - 0xe2, 0xe0, 0x8a, 0x20, 0x2e, 0x3d, 0x91, 0x92, 0x54, 0x6a, 0x09, 0x21, 0x5a, 0x54, 0x0e, 0x1c, - 0x30, 0x1b, 0x7b, 0x94, 0x2e, 0xc4, 0xde, 0x60, 0x6f, 0x23, 0xf1, 0x0a, 0xf0, 0x22, 0x88, 0x17, - 0x40, 0xe2, 0x39, 0x78, 0x0a, 0x9e, 0x02, 0x79, 0xed, 0x98, 0xb8, 0xb1, 0x01, 0xa9, 0xe2, 0xe6, - 0xf9, 0xe6, 0xf3, 0xec, 0xb7, 0x33, 0xdf, 0x2c, 0xdc, 0x9e, 0xf1, 0x05, 0xbe, 0xe3, 0xd2, 0x65, - 0x53, 0x0c, 0xa5, 0xeb, 0xf3, 0x78, 0xce, 0xa4, 0x77, 0xee, 0xcc, 0x23, 0x21, 0x05, 0xd9, 0xca, - 0xb2, 0xf6, 0x8d, 0x02, 0x2d, 0xcd, 0xda, 0x3b, 0x33, 0x31, 0x9d, 0x62, 0x74, 0x20, 0xe6, 0x92, - 0x8b, 0x30, 0x4e, 0xd1, 0xce, 0x77, 0x0d, 0xec, 0x27, 0x11, 0x32, 0x89, 0xbd, 0x84, 0xdb, 0xcf, - 0x2a, 0x52, 0x7c, 0x7f, 0x81, 0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f4, 0x1c, + 0xf4, 0xe4, 0xf9, 0xc9, 0x07, 0x7a, 0x90, 0x6b, 0xae, 0x7e, 0x97, 0xcc, 0x0a, 0xc3, 0xc4, 0xe9, + 0x92, 0x0d, 0x2a, 0x49, 0x57, 0xbd, 0x5a, 0x95, 0xe9, 0x4e, 0x61, 0x37, 0xb6, 0x73, 0x7e, 0xbe, + 0x9f, 0xf3, 0xaa, 0xb6, 0xc8, 0xec, 0xfc, 0x8e, 0x92, 0x2c, 0xc2, 0xf0, 0xe8, 0xf5, 0xc1, 0x82, + 0x89, 0xb3, 0xf3, 0xb9, 0xe5, 0x70, 0xbf, 0x97, 0xf2, 0x7b, 0xf2, 0x41, 0x76, 0xb8, 0x97, 0x01, + 0x5f, 0xd4, 0xe6, 0x84, 0xad, 0xe8, 0x33, 0x26, 0xac, 0x59, 0x1c, 0xfa, 0xa1, 0xea, 0xe9, 0xf9, + 0xf0, 0x50, 0x02, 0xf3, 0x6d, 0xf9, 0xcb, 0xa3, 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0d, 0xcf, + 0x6a, 0x4d, 0x17, 0x06, 0x00, 0x00, } diff --git a/observability/agentsv2obs/agent.go b/observability/agentsv3obs/agent.go similarity index 97% rename from observability/agentsv2obs/agent.go rename to observability/agentsv3obs/agent.go index 8e7860680..fd677ca32 100644 --- a/observability/agentsv2obs/agent.go +++ b/observability/agentsv3obs/agent.go @@ -1,4 +1,4 @@ -package agentsv2obs +package agentsv3obs import "github.com/livekit/protocol/livekit" diff --git a/observability/agentsv2obs/gen_reporter.go b/observability/agentsv3obs/gen_reporter.go similarity index 85% rename from observability/agentsv2obs/gen_reporter.go rename to observability/agentsv3obs/gen_reporter.go index 3407ab7a4..bede61b73 100644 --- a/observability/agentsv2obs/gen_reporter.go +++ b/observability/agentsv3obs/gen_reporter.go @@ -1,12 +1,12 @@ // Code generated; DO NOT EDIT. -package agentsv2obs +package agentsv3obs import ( "time" ) -const Version_Q2H41LG = true +const Version_MAT8U20 = true type KeyResolver interface { Resolve(string) @@ -29,33 +29,16 @@ type ProjectReporter interface { RegisterFunc(func(ts time.Time, tx ProjectTx) bool) Tx(func(tx ProjectTx)) TxAt(time.Time, func(tx ProjectTx)) - WithEnv(name string) EnvReporter - WithDeferredEnv() (EnvReporter, KeyResolver) - projectReporter -} - -type envReporter interface { -} - -type EnvTx interface { - Project() ProjectTx - envReporter -} - -type EnvReporter interface { - RegisterFunc(func(ts time.Time, tx EnvTx) bool) - Tx(func(tx EnvTx)) - TxAt(time.Time, func(tx EnvTx)) WithCloudAgent(id string) CloudAgentReporter WithDeferredCloudAgent() (CloudAgentReporter, KeyResolver) - envReporter + projectReporter } type cloudAgentReporter interface { } type CloudAgentTx interface { - Env() EnvTx + Project() ProjectTx cloudAgentReporter } @@ -80,9 +63,26 @@ type AgentReporter interface { RegisterFunc(func(ts time.Time, tx AgentTx) bool) Tx(func(tx AgentTx)) TxAt(time.Time, func(tx AgentTx)) + WithDeployment(name string) DeploymentReporter + WithDeferredDeployment() (DeploymentReporter, KeyResolver) + agentReporter +} + +type deploymentReporter interface { +} + +type DeploymentTx interface { + Agent() AgentTx + deploymentReporter +} + +type DeploymentReporter interface { + RegisterFunc(func(ts time.Time, tx DeploymentTx) bool) + Tx(func(tx DeploymentTx)) + TxAt(time.Time, func(tx DeploymentTx)) WithWorker(id string) WorkerReporter WithDeferredWorker() (WorkerReporter, KeyResolver) - agentReporter + deploymentReporter } type workerReporter interface { @@ -103,7 +103,7 @@ type workerReporter interface { } type WorkerTx interface { - Agent() AgentTx + Deployment() DeploymentTx workerReporter } diff --git a/observability/agentsv2obs/gen_reporter_noop.go b/observability/agentsv3obs/gen_reporter_noop.go similarity index 84% rename from observability/agentsv2obs/gen_reporter_noop.go rename to observability/agentsv3obs/gen_reporter_noop.go index 5694bd54c..250c2e160 100644 --- a/observability/agentsv2obs/gen_reporter_noop.go +++ b/observability/agentsv3obs/gen_reporter_noop.go @@ -1,6 +1,6 @@ // Code generated; DO NOT EDIT. -package agentsv2obs +package agentsv3obs import ( "time" @@ -10,12 +10,12 @@ var ( _ Reporter = (*noopReporter)(nil) _ ProjectReporter = (*noopProjectReporter)(nil) _ ProjectTx = (*noopProjectTx)(nil) - _ EnvReporter = (*noopEnvReporter)(nil) - _ EnvTx = (*noopEnvTx)(nil) _ CloudAgentReporter = (*noopCloudAgentReporter)(nil) _ CloudAgentTx = (*noopCloudAgentTx)(nil) _ AgentReporter = (*noopAgentReporter)(nil) _ AgentTx = (*noopAgentTx)(nil) + _ DeploymentReporter = (*noopDeploymentReporter)(nil) + _ DeploymentTx = (*noopDeploymentTx)(nil) _ WorkerReporter = (*noopWorkerReporter)(nil) _ WorkerTx = (*noopWorkerTx)(nil) _ JobReporter = (*noopJobReporter)(nil) @@ -50,36 +50,14 @@ func NewNoopProjectReporter() ProjectReporter { func (r *noopProjectReporter) RegisterFunc(f func(ts time.Time, tx ProjectTx) bool) {} func (r *noopProjectReporter) Tx(f func(ProjectTx)) {} func (r *noopProjectReporter) TxAt(ts time.Time, f func(ProjectTx)) {} -func (r *noopProjectReporter) WithEnv(name string) EnvReporter { - return &noopEnvReporter{} -} -func (r *noopProjectReporter) WithDeferredEnv() (EnvReporter, KeyResolver) { - return &noopEnvReporter{}, noopKeyResolver{} -} - -type noopProjectTx struct{} - -type noopEnvReporter struct{} - -func NewNoopEnvReporter() EnvReporter { - return &noopEnvReporter{} -} - -func (r *noopEnvReporter) RegisterFunc(f func(ts time.Time, tx EnvTx) bool) {} -func (r *noopEnvReporter) Tx(f func(EnvTx)) {} -func (r *noopEnvReporter) TxAt(ts time.Time, f func(EnvTx)) {} -func (r *noopEnvReporter) WithCloudAgent(id string) CloudAgentReporter { +func (r *noopProjectReporter) WithCloudAgent(id string) CloudAgentReporter { return &noopCloudAgentReporter{} } -func (r *noopEnvReporter) WithDeferredCloudAgent() (CloudAgentReporter, KeyResolver) { +func (r *noopProjectReporter) WithDeferredCloudAgent() (CloudAgentReporter, KeyResolver) { return &noopCloudAgentReporter{}, noopKeyResolver{} } -type noopEnvTx struct{} - -func (t *noopEnvTx) Project() ProjectTx { - return &noopProjectTx{} -} +type noopProjectTx struct{} type noopCloudAgentReporter struct{} @@ -99,8 +77,8 @@ func (r *noopCloudAgentReporter) WithDeferredAgent() (AgentReporter, KeyResolver type noopCloudAgentTx struct{} -func (t *noopCloudAgentTx) Env() EnvTx { - return &noopEnvTx{} +func (t *noopCloudAgentTx) Project() ProjectTx { + return &noopProjectTx{} } type noopAgentReporter struct{} @@ -112,11 +90,11 @@ func NewNoopAgentReporter() AgentReporter { func (r *noopAgentReporter) RegisterFunc(f func(ts time.Time, tx AgentTx) bool) {} func (r *noopAgentReporter) Tx(f func(AgentTx)) {} func (r *noopAgentReporter) TxAt(ts time.Time, f func(AgentTx)) {} -func (r *noopAgentReporter) WithWorker(id string) WorkerReporter { - return &noopWorkerReporter{} +func (r *noopAgentReporter) WithDeployment(name string) DeploymentReporter { + return &noopDeploymentReporter{} } -func (r *noopAgentReporter) WithDeferredWorker() (WorkerReporter, KeyResolver) { - return &noopWorkerReporter{}, noopKeyResolver{} +func (r *noopAgentReporter) WithDeferredDeployment() (DeploymentReporter, KeyResolver) { + return &noopDeploymentReporter{}, noopKeyResolver{} } type noopAgentTx struct{} @@ -125,6 +103,28 @@ func (t *noopAgentTx) CloudAgent() CloudAgentTx { return &noopCloudAgentTx{} } +type noopDeploymentReporter struct{} + +func NewNoopDeploymentReporter() DeploymentReporter { + return &noopDeploymentReporter{} +} + +func (r *noopDeploymentReporter) RegisterFunc(f func(ts time.Time, tx DeploymentTx) bool) {} +func (r *noopDeploymentReporter) Tx(f func(DeploymentTx)) {} +func (r *noopDeploymentReporter) TxAt(ts time.Time, f func(DeploymentTx)) {} +func (r *noopDeploymentReporter) WithWorker(id string) WorkerReporter { + return &noopWorkerReporter{} +} +func (r *noopDeploymentReporter) WithDeferredWorker() (WorkerReporter, KeyResolver) { + return &noopWorkerReporter{}, noopKeyResolver{} +} + +type noopDeploymentTx struct{} + +func (t *noopDeploymentTx) Agent() AgentTx { + return &noopAgentTx{} +} + type noopWorkerReporter struct{} func NewNoopWorkerReporter() WorkerReporter { @@ -157,8 +157,8 @@ func (r *noopWorkerReporter) WithDeferredJob() (JobReporter, KeyResolver) { type noopWorkerTx struct{} -func (t *noopWorkerTx) Agent() AgentTx { - return &noopAgentTx{} +func (t *noopWorkerTx) Deployment() DeploymentTx { + return &noopDeploymentTx{} } func (t *noopWorkerTx) ReportLoad(v float32) {} diff --git a/observability/agentsv2obs/gen_source.go b/observability/agentsv3obs/gen_source.go similarity index 98% rename from observability/agentsv2obs/gen_source.go rename to observability/agentsv3obs/gen_source.go index 30680c903..876176517 100644 --- a/observability/agentsv2obs/gen_source.go +++ b/observability/agentsv3obs/gen_source.go @@ -1,5 +1,5 @@ // Code generated; DO NOT EDIT. -package agentsv2obs +package agentsv3obs type WorkerStatus string diff --git a/observability/reporter.go b/observability/reporter.go index eff488b9f..0adcb1210 100644 --- a/observability/reporter.go +++ b/observability/reporter.go @@ -3,7 +3,7 @@ package observability import ( "github.com/livekit/protocol/logger" "github.com/livekit/protocol/observability/agentsobs" - "github.com/livekit/protocol/observability/agentsv2obs" + "github.com/livekit/protocol/observability/agentsv3obs" "github.com/livekit/protocol/observability/corecallobs" "github.com/livekit/protocol/observability/egressobs" "github.com/livekit/protocol/observability/gatewayobs" @@ -20,7 +20,7 @@ type Reporter interface { Logger(name, projectID string) (logger.Logger, error) Room() roomobs.Reporter Agent() agentsobs.Reporter - AgentV2() agentsv2obs.Reporter + AgentV3() agentsv3obs.Reporter Gateway() gatewayobs.Reporter Telephony() telephonyobs.Reporter Egress() egressobs.Reporter @@ -49,8 +49,8 @@ func (reporter) Agent() agentsobs.Reporter { return agentsobs.NewNoopReporter() } -func (reporter) AgentV2() agentsv2obs.Reporter { - return agentsv2obs.NewNoopReporter() +func (reporter) AgentV3() agentsv3obs.Reporter { + return agentsv3obs.NewNoopReporter() } func (reporter) Gateway() gatewayobs.Reporter { diff --git a/protobufs/livekit_agent.proto b/protobufs/livekit_agent.proto index 7e00c2268..e269ab55a 100644 --- a/protobufs/livekit_agent.proto +++ b/protobufs/livekit_agent.proto @@ -33,7 +33,7 @@ message Job { string agent_name = 7; JobState state = 8; bool enable_recording = 10; - string environment = 11; + string deployment = 11; } message JobState { @@ -121,7 +121,7 @@ message RegisterWorkerRequest { uint32 ping_interval = 5; optional string namespace = 6; ParticipantPermission allowed_permissions = 7; - string environment = 9; + string deployment = 9; } message RegisterWorkerResponse { diff --git a/protobufs/livekit_agent_dispatch.proto b/protobufs/livekit_agent_dispatch.proto index 981981dc9..630efbff9 100644 --- a/protobufs/livekit_agent_dispatch.proto +++ b/protobufs/livekit_agent_dispatch.proto @@ -38,14 +38,14 @@ message CreateAgentDispatchRequest { string room = 2; string metadata = 3 [(logger.redact) = true]; JobRestartPolicy restart_policy = 4; // cloud only - string environment = 5; + string deployment = 5; } message RoomAgentDispatch { string agent_name = 1; string metadata = 2 [(logger.redact) = true]; JobRestartPolicy restart_policy = 3; // cloud only - string environment = 4; + string deployment = 4; } message DeleteAgentDispatchRequest { @@ -69,7 +69,7 @@ message AgentDispatch { string metadata = 4 [(logger.redact) = true]; AgentDispatchState state = 5; JobRestartPolicy restart_policy = 6; // cloud only - string environment = 7; + string deployment = 7; } message AgentDispatchState {