package exec

import "context"

// Each concrete operation embeds exactly one transport family. The family base
// owns capability derivation and the operation method can only receive that
// concrete transport through the embedded state. There is no function field or
// separately captured handler runtime in a production invoker.

type invokeAgentListObject struct {
	localReadInvoker
}

func (inv invokeAgentListObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body agentListRequest) (actionResult[agentListResult], error) {
	request := actionScopedJSON[agentListRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (agentHandler{source: transport.source}).list(ctx, request)
}

type invokeAgentGetObject struct {
	localReadInvoker
}

func (inv invokeAgentGetObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body agentGetRequest) (actionResult[agentGetResult], error) {
	request := actionScopedJSON[agentGetRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (agentHandler{source: transport.source}).get(ctx, request)
}

type invokeAgentStartObject struct {
	requestReceiptInvoker
}

func (inv invokeAgentStartObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body agentLifecycleRequest) (actionResult[agentStartResponse], error) {
	request := actionScopedJSON[agentLifecycleRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (agentHandler{receipt: transport}).start(ctx, request)
}

type invokeAgentStopObject struct {
	requestReceiptInvoker
}

func (inv invokeAgentStopObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body agentLifecycleRequest) (actionResult[agentStopOutcome], error) {
	request := actionScopedJSON[agentLifecycleRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (agentHandler{receipt: transport}).stop(ctx, request)
}

type invokeAgentRestartObject struct {
	requestReceiptInvoker
}

func (inv invokeAgentRestartObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body agentLifecycleRequest) (actionResult[agentRestartResponse], error) {
	request := actionScopedJSON[agentLifecycleRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (agentHandler{receipt: transport}).restart(ctx, request)
}

type invokeAgentCreateObject struct {
	requestReceiptInvoker
}

func (inv invokeAgentCreateObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body agentCreateRequest) (actionResult[agentStructuralResponse], error) {
	request := actionScopedJSON[agentCreateRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (agentHandler{receipt: transport}).create(ctx, request)
}

type invokeAgentUpdateObject struct {
	requestReceiptInvoker
}

func (inv invokeAgentUpdateObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body agentUpdateRequest) (actionResult[agentStructuralResponse], error) {
	request := actionScopedJSON[agentUpdateRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (agentHandler{receipt: transport}).update(ctx, request)
}

type invokeAgentDeleteObject struct {
	requestReceiptInvoker
}

func (inv invokeAgentDeleteObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body agentDeleteRequest) (actionResult[agentStructuralResponse], error) {
	request := actionScopedJSON[agentDeleteRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (agentHandler{receipt: transport}).delete(ctx, request)
}

type invokeAgentDuplicateObject struct {
	requestReceiptInvoker
}

func (inv invokeAgentDuplicateObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body agentDuplicateRequest) (actionResult[agentStructuralResponse], error) {
	request := actionScopedJSON[agentDuplicateRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (agentHandler{receipt: transport}).duplicate(ctx, request)
}

type invokeTeamListObject struct {
	remoteReadInvoker
}

func (inv invokeTeamListObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body teamListInput) (actionResult[teamListOutput], error) {
	request := actionScopedJSON[teamListInput]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (teamHandler{read: transport}).list(ctx, request)
}

type invokeTeamGetObject struct {
	remoteReadInvoker
}

func (inv invokeTeamGetObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body teamGetInput) (actionResult[teamGetOutput], error) {
	request := actionScopedJSON[teamGetInput]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (teamHandler{read: transport}).get(ctx, request)
}

type invokeTeamUpdateObject struct {
	requestReceiptInvoker
}

func (inv invokeTeamUpdateObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body teamUpdateInput) (actionResult[teamUpdateOutput], error) {
	request := actionScopedJSON[teamUpdateInput]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (teamHandler{receipt: transport}).update(ctx, request)
}

type invokeChannelListObject struct {
	remoteReadInvoker
}

func (inv invokeChannelListObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body channelListInput) (actionResult[channelListOutput], error) {
	request := actionScopedJSON[channelListInput]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (channelHandler{read: transport}).list(ctx, request)
}

type invokeChannelGetObject struct {
	remoteReadInvoker
}

func (inv invokeChannelGetObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body channelGetInput) (actionResult[channelGetOutput], error) {
	request := actionScopedJSON[channelGetInput]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (channelHandler{read: transport}).get(ctx, request)
}

type invokeChannelMembersObject struct {
	remoteReadInvoker
}

func (inv invokeChannelMembersObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body channelMembersInput) (actionResult[channelMembersOutput], error) {
	request := actionScopedJSON[channelMembersInput]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (channelHandler{read: transport}).members(ctx, request)
}

type invokeChannelCreateObject struct {
	requestReceiptInvoker
}

func (inv invokeChannelCreateObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body channelCreateInput) (actionResult[channelCreateOutput], error) {
	request := actionScopedJSON[channelCreateInput]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (channelHandler{receipt: transport}).create(ctx, request)
}

type invokeChannelUpdateObject struct {
	requestReceiptInvoker
}

func (inv invokeChannelUpdateObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body channelUpdateInput) (actionResult[channelUpdateOutput], error) {
	request := actionScopedJSON[channelUpdateInput]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (channelHandler{receipt: transport}).update(ctx, request)
}

type invokeChannelAgentAddObject struct {
	requestReceiptInvoker
}

func (inv invokeChannelAgentAddObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body channelAgentAddInput) (actionResult[channelAgentMutationOutput], error) {
	request := actionScopedJSON[channelAgentAddInput]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (channelHandler{receipt: transport}).agentAdd(ctx, request)
}

type invokeChannelAgentRemoveObject struct {
	requestReceiptInvoker
}

func (inv invokeChannelAgentRemoveObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body channelAgentRemoveInput) (actionResult[channelAgentMutationOutput], error) {
	request := actionScopedJSON[channelAgentRemoveInput]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (channelHandler{receipt: transport}).agentRemove(ctx, request)
}

type invokeProfileSetAvatarObject struct {
	naturalMutationInvoker
}

func (inv invokeProfileSetAvatarObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body profileSetAvatarRequest) (actionResult[profileSetAvatarResult], error) {
	request := actionScopedJSON[profileSetAvatarRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (profileHandler{natural: transport}).setAvatar(ctx, request)
}

type invokeProjectListObject struct {
	remoteReadInvoker
}

func (inv invokeProjectListObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body projectListRequest) (actionResult[projectListResponse], error) {
	request := actionScopedJSON[projectListRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (projectHandler{read: transport}).list(ctx, request)
}

type invokeProjectCreateObject struct {
	naturalMutationInvoker
}

func (inv invokeProjectCreateObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body projectCreateRequestDTO) (actionResult[projectCreateResponse], error) {
	request := actionScopedJSON[projectCreateRequestDTO]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (projectHandler{natural: transport}).create(ctx, request)
}

type invokeProjectDeleteObject struct {
	naturalMutationInvoker
}

func (inv invokeProjectDeleteObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body projectDeleteRequest) (actionResult[projectDeleteResponse], error) {
	request := actionScopedJSON[projectDeleteRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (projectHandler{natural: transport}).delete(ctx, request)
}

type invokeReviewAddObject struct {
	naturalMutationInvoker
}

func (inv invokeReviewAddObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body reviewAddInput) (actionResult[reviewAddResult], error) {
	request := actionScopedJSON[reviewAddInput]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (reviewHandler{natural: transport}).add(ctx, request)
}

type invokeReviewListObject struct {
	remoteReadInvoker
}

func (inv invokeReviewListObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body reviewListRequest) (actionResult[reviewListResult], error) {
	request := actionScopedJSON[reviewListRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (reviewHandler{read: transport}).list(ctx, request)
}

type invokeReviewDeleteObject struct {
	naturalMutationInvoker
}

func (inv invokeReviewDeleteObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body reviewDeleteRequest) (actionResult[reviewDeleteResult], error) {
	request := actionScopedJSON[reviewDeleteRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (reviewHandler{natural: transport}).delete(ctx, request)
}

type invokeRoleListObject struct {
	remoteReadInvoker
}

func (inv invokeRoleListObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body roleListRequest) (actionResult[roleListResult], error) {
	request := actionScopedJSON[roleListRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (roleHandler{read: transport}).list(ctx, request)
}

type invokeRoleGetObject struct {
	remoteReadInvoker
}

func (inv invokeRoleGetObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body roleGetRequest) (actionResult[roleGetResult], error) {
	request := actionScopedJSON[roleGetRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (roleHandler{read: transport}).get(ctx, request)
}

type invokeRoleRequestGetObject struct {
	remoteReadInvoker
}

func (inv invokeRoleRequestGetObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body roleRequestGetRequest) (actionResult[roleRequestGetResult], error) {
	request := actionScopedJSON[roleRequestGetRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (roleHandler{read: transport}).requestGet(ctx, request)
}

type invokeRoleCreateObject struct {
	requestReceiptInvoker
}

func (inv invokeRoleCreateObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body roleCreateRequest) (actionResult[roleRequestResponse], error) {
	request := actionScopedJSON[roleCreateRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (roleHandler{receipt: transport}).create(ctx, request)
}

type invokeRoleUpdateObject struct {
	requestReceiptInvoker
}

func (inv invokeRoleUpdateObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body roleUpdateRequest) (actionResult[roleRequestResponse], error) {
	request := actionScopedJSON[roleUpdateRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (roleHandler{receipt: transport}).update(ctx, request)
}

type invokeRoleDeleteObject struct {
	requestReceiptInvoker
}

func (inv invokeRoleDeleteObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body roleDeleteRequest) (actionResult[roleRequestResponse], error) {
	request := actionScopedJSON[roleDeleteRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (roleHandler{receipt: transport}).delete(ctx, request)
}

type invokeRoleApplyObject struct {
	requestReceiptInvoker
}

func (inv invokeRoleApplyObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body roleApplyRequest) (actionResult[roleRequestResponse], error) {
	request := actionScopedJSON[roleApplyRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (roleHandler{receipt: transport}).apply(ctx, request)
}

type invokeSkillListObject struct {
	remoteReadInvoker
}

func (inv invokeSkillListObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body skillListRequest) (actionResult[skillListResult], error) {
	request := actionScopedJSON[skillListRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (skillHandler{read: transport}).list(ctx, request)
}

type invokeSkillGetObject struct {
	remoteReadInvoker
}

func (inv invokeSkillGetObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body skillGetRequest) (actionResult[skill], error) {
	request := actionScopedJSON[skillGetRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (skillHandler{read: transport}).get(ctx, request)
}

type invokeSkillCreateObject struct {
	naturalMutationInvoker
}

func (inv invokeSkillCreateObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body skillCreateRequest) (actionResult[skill], error) {
	request := actionScopedJSON[skillCreateRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (skillHandler{natural: transport}).create(ctx, request)
}

type invokeSkillUpdateObject struct {
	naturalMutationInvoker
}

func (inv invokeSkillUpdateObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body skillUpdateRequest) (actionResult[skill], error) {
	request := actionScopedJSON[skillUpdateRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (skillHandler{natural: transport}).update(ctx, request)
}

type invokeSkillImportObject struct {
	naturalMutationInvoker
}

func (inv invokeSkillImportObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body skillImportRequest) (actionResult[skillImportResult], error) {
	request := actionScopedJSON[skillImportRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (skillHandler{natural: transport}).importContent(ctx, request)
}

type invokeSkillDeleteObject struct {
	requestReceiptInvoker
}

func (inv invokeSkillDeleteObject) Invoke(ctx context.Context, authorized runtimeAuthorization, body skillDeleteRequest) (actionResult[skillDeleteResult], error) {
	request := actionScopedJSON[skillDeleteRequest]{Authorized: authorized, Body: body}
	transport := inv.transport
	return (skillHandler{receipt: transport}).delete(ctx, request)
}
